Skip to content

[flink] Report which required argument is missing in action factories - #9059

Open
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/action-required-arg-name
Open

[flink] Report which required argument is missing in action factories#9059
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/action-required-arg-name

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #9058

  • Omitting a required action argument produces an exception that does not say which argument is missing: merge_into throws a bare NullPointerException, create_tag_from_timestamp and create_tag_from_watermark throw NumberFormatException: null.
  • Those four arguments (merge_actions, timestamp, tag, watermark) are read with params.get(...) and dereferenced at once.
  • Their sibling arguments already use params.getRequired(...), which reports Argument '<name>' is required.; DropPartitionActionFactory enforces the same contract.
  • Same defect class as [flink] Fix migrate actions crashing when parallelism is not specified #8611, which fixed only the migrate_* factories.

Tests

  • Added MergeIntoActionFactoryTest, CreateTagFromTimestampActionFactoryTest and CreateTagFromWatermarkActionFactoryTest (7 tests). The four missing-argument tests fail without this change.
  • mvn -pl paimon-flink/paimon-flink-common -Pflink1 -DfailIfNoTests=false clean install — BUILD SUCCESS, 2258 tests, 0 failures, 8 skipped.

Four required action arguments were read with params.get(...) and
dereferenced immediately, so omitting one failed with a bare
NullPointerException (merge_actions) or NumberFormatException: null
(timestamp, watermark) that never named the missing argument. Read them
with params.getRequired(...), like every sibling argument in the same
methods, so the failure reports the argument name.

Generated-by: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Flink action factories do not report which required argument is missing

1 participant