Skip to content

[FLINK-40167][table] Add EARLY_FIRE join hint surface and option validation - #28353

Merged
RocMarshal merged 5 commits into
apache:masterfrom
weiqingy:FLINK-36953-impl
Jul 25, 2026
Merged

[FLINK-40167][table] Add EARLY_FIRE join hint surface and option validation#28353
RocMarshal merged 5 commits into
apache:masterfrom
weiqingy:FLINK-36953-impl

Conversation

@weiqingy

@weiqingy weiqingy commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

This is the first PR of the FLIP-497 implementation, split into a stack of small, independently reviewable PRs under the umbrella issue FLINK-36953. Landing order:

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

What is the purpose of the change

Introduces the EARLY_FIRE join hint for SQL interval joins: its typed options and key-value validation. The hint is recognized and validated here, but no rule consumes it yet, so it has no planning or runtime effect beyond accepting the new syntax. Threading it into the interval join follows in PR-1b. This keeps the foundational surface layer small and isolated.

Brief change log

  • Add EarlyFireJoinHintOptions (@PublicEvolving): delay (required), time-mode (optional), and the nested TimeMode enum.
  • Register EARLY_FIRE in JoinStrategy and FlinkHintStrategies with a key-value option checker (delay must be a positive duration; time-mode must be rowtime/proctime).
  • Wire the query-hint propagation touchpoints (CapitalizeQueryHintsShuttle, QueryHintsResolver).
  • Exclude EARLY_FIRE from the generic join-hint test coverage and from config-docs generation.

Verifying this change

This change added tests and can be verified as follows:

  • Added IntervalJoinTest validation cases (required delay, positive delay, time-mode enum, unknown option). Generic join-hint tests stay green with EARLY_FIRE excluded from their coverage.

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 @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 (the first step of FLIP-497)
  • If yes, how is the feature documented? The user-facing documentation lands in the docs 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)

@flinkbot

flinkbot commented Jun 7, 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

weiqingy commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Hi @wuchong @xuyangzhong @xccui Could you please help review this PR? Thanks!

@MartijnVisser

Copy link
Copy Markdown
Contributor

@weiqingy This FLIP doesn't have the necessary nr of approved binding votes, so it's not OK to implement this

@RocMarshal

Copy link
Copy Markdown
Contributor

Thanks @weiqingy @MartijnVisser
I'll take a look for the FLIP wiki ASAP.

BWT, @weiqingy

  • Would you mind helping bumping the discuss email thread and voting email thread?
  • Also, could we break this pull request down into several smaller patches? It will help reviewers go through the code more efficiently.

Pls let know what's your opinion.

@weiqingy

weiqingy commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi @MartijnVisser @RocMarshal, thanks for reviewing the PR! I’ve CCed you both on the Discussion, Voting, and Voting Result email thread. I believe we have 3 binding votes, but please let me know if I missed anything.

@weiqingy

weiqingy commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

could we break this pull request down into several smaller patches? It will help reviewers go through the code more efficiently.

@RocMarshal Sounds good. I’ll follow up and look into how to break this PR down into smaller patches.

@MartijnVisser

Copy link
Copy Markdown
Contributor

I believe we have 3 binding votes, but please let me know if I missed anything.

I can only see 2 binding votes, I've replied in the thread as well

@raminqaf raminqaf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for now, I recommend to switch to a draft PR. After, the FLIP voting settles we can re-open it.

@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label Jun 9, 2026
@weiqingy

Copy link
Copy Markdown
Contributor Author

Hi @MartijnVisser, @raminqaf, and @RocMarshal,

Thanks to all of you for the reviews, suggestions, and clarification.

@MartijnVisser: Thanks for clarifying the bylaws. To share my thought process on the tally: when I was gathering the results, Xuyang had become an active committer. I assumed his initial "+1 (non-binding)" vote transitioned to a binding vote along with his new status, which would have brought the total to 3 [1]. I appreciate you pointing this out. I agree with your suggestion to restart the process. Since the thread has been open for over a year, having a new round of discussion is the best way to ensure the design is fully aligned with the current state of the project. I will kick off a new [DISCUSS] thread soon. I also replied in the voting email thread to ensure everyone is on the same page [2].

@raminqaf: I will go ahead and convert this PR to a draft while the new FLIP discussion and voting settle, as you recommended.

@RocMarshal: While the FLIP is being re-discussed, I will use the time to look into how to best break this PR down into smaller, more reviewable patches as you suggested.

Thanks again for the guidance, everyone!

[1] https://lists.apache.org/thread/dcn78blz7cqmmyypw897w0dvf6l58cnt
[2] https://lists.apache.org/thread/mw0tqgg1yx0mn8tf6msrgdtqbpdpgtpt

@weiqingy
weiqingy marked this pull request as draft June 10, 2026 02:58
@weiqingy weiqingy changed the title [FLINK-36953][table] Early fire support for Flink SQL interval join Jul 18, 2026
…dation

Register the EARLY_FIRE join hint and its typed options
(EarlyFireJoinHintOptions: delay, time_mode) with a key-value option
checker, and wire the query-hint propagation touchpoints. Exclude
EARLY_FIRE from the generic join-hint test coverage and config-docs
generation, since it is a key-value hint validated on its own.

The hint is recognized and validated here but not yet consumed by any
rule; threading it into the interval join follows in a separate change.
@weiqingy weiqingy changed the title [FLINK-36953][table] Add EARLY_FIRE join hint surface and planner plumbing Jul 18, 2026
@weiqingy weiqingy changed the title [FLINK-36953][table] Add EARLY_FIRE join hint surface and option validation Jul 18, 2026
@weiqingy
weiqingy marked this pull request as ready for review July 18, 2026 23:46
@weiqingy

Copy link
Copy Markdown
Contributor Author

Thanks everyone for the FLIP-497 discussion and vote 🙏

This kicks off the implementation as a stack of 8 small, independently reviewable PRs (roadmap + sub-tasks FLINK-40167–40174 in the description). This first one, PR-1a, only adds the EARLY_FIRE hint surface and option validation — it's inert (no rule consumes the hint yet); threading follows in PR-1b.

@xuyangzhong @xccui @RocMarshal — when you have a moment, I'd appreciate your review here. Feedback on the overall split/granularity is welcome too.

weiqingy added 2 commits July 20, 2026 18:46
…time-mode

Flink option keys use hyphens (e.g. output-mode, fixed-delay); rename the
EARLY_FIRE hint's time_mode option key to time-mode to match, and update
the affected tests.
…idation tests

The runtime uses delay.toMillis(), so a sub-millisecond delay truncates to
zero. Make the contract explicit: require at least 1 millisecond in the DELAY
description and the checker error message. Add coverage for a sub-millisecond
delay, list-style options (only key-value is supported), and case-insensitive
hint-name capitalization that preserves the key-value options.
weiqingy added 2 commits July 21, 2026 11:07
…test class

Move the EARLY_FIRE hint surface and option-validation tests out of the
Scala IntervalJoinTest into a dedicated Java EarlyFireJoinHintTest (under
plan/hints/stream, mirroring StateTtlHintTest), and relocate their plan
golden accordingly. IntervalJoinTest keeps only its original tests.
Wrap the assertThatThrownBy chain in testEarlyFireListOptionsRejected to
satisfy Spotless.

@RocMarshal RocMarshal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

Thanks @weiqingy for the hard work.

Pls let us wait for a few days for more comments.

@snuyanzin Could you help take a look if you had the free time? Thank you.

@RocMarshal

Copy link
Copy Markdown
Contributor

Given the lack of further responses over the past three business days, we will proceed with merging this PR to keep things moving. If there are additional suggestions, please feel free to submit a hotfix or follow-up PR.

Thanks!

@RocMarshal
RocMarshal merged commit 1ea8cb0 into apache:master Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

5 participants