Skip to content

[FLINK-40169][table] Add target option to the EARLY_FIRE hint#28827

Draft
weiqingy wants to merge 2 commits into
apache:masterfrom
weiqingy:FLINK-36953-pr2-target
Draft

[FLINK-40169][table] Add target option to the EARLY_FIRE hint#28827
weiqingy wants to merge 2 commits into
apache:masterfrom
weiqingy:FLINK-36953-pr2-target

Conversation

@weiqingy

Copy link
Copy Markdown
Contributor

Part of the FLIP-497 implementation stack under umbrella FLINK-36953. Landing order:

Step Sub-task Scope
PR-1a FLINK-40167 EARLY_FIRE hint surface + option validation (#28353, merged)
PR-1b FLINK-40168 Thread the hint into the interval join (#28796, approved)
PR-2 (this PR) FLINK-40169 target option
PR-3 FLINK-40170 Update-producing changelog mode + insert-only guard
PR-4 FLINK-40171 Runtime early-fire emit + retraction
PR-5 FLINK-40172 Processing-time early fire on an event-time join
PR-6 FLINK-40173 State restore coverage
PR-7 FLINK-40174 User-facing documentation

Opened as a draft because it is stacked on #28796, which is approved and awaiting merge. Until that lands, the commit list and diff here also carry PR-1b's commit. Once #28796 merges I will rebase onto master, leaving only this PR's change, and take it out of draft.

What is the purpose of the change

Adds an optional target option to the EARLY_FIRE hint so a hint can be explicitly scoped to a single operator kind. Only interval_join is accepted today, and an omitted target means interval_join, so existing hints keep their meaning. This is a forward-compatibility guard: it keeps a bare EARLY_FIRE hint from silently expanding its scope if other operators honor the hint in the future.

Brief change log

  • Add EarlyFireJoinHintOptions.TARGET (optional stringType) and the INTERVAL_JOIN constant.
  • The EARLY_FIRE KV option checker validates target against the supported set. Any other value fails planning.
  • StreamPhysicalIntervalJoinRule applies the hint only when it targets the interval join, and leaves a hint aimed at another operator kind untouched. That rule-level check is redundant with validation today, since an unsupported value already fails planning. It is there so that a hint aimed at a future operator kind is ignored by this rule rather than misapplied.

Verifying this change

This change added tests and can be verified as follows:

  • EarlyFireJoinHintTest: an explicit target='interval_join' still threads earlyFireDelay/earlyFireTimeMode into the exec plan, and an unsupported target value fails planning with a message naming the supported set.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): yes (a new option on the @PublicEvolving EarlyFireJoinHintOptions)
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes (an option on the FLIP-497 hint)
  • If yes, how is the feature documented? in the documentation PR at the end of this stack (PR-7)

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code (Anthropic)

weiqingy added 2 commits July 24, 2026 19:07
Add an optional `target` option to the EARLY_FIRE join hint. Only
`interval_join` is accepted today; any other value fails planning. An
omitted target is equivalent to `interval_join`, so existing hints keep
their meaning.

`target` scopes the hint to a single operator kind. The interval-join
rule consumes the hint only when it targets the interval join and leaves
a hint aimed at another operator kind untouched, so an untargeted hint
never silently expands its scope.
@flinkbot

flinkbot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@weiqingy

Copy link
Copy Markdown
Contributor Author

Hi @RocMarshal, opening PR-2 of the FLIP-497 stack early as a draft so it's queued behind #28796.

Since it's stacked, the commit list and diff here also carry #28796's commit for now. Once that one is merged I'll rebase this onto master, leaving only the target option change, and take it out of draft for review.

Thanks!

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.

2 participants