Skip to content

[FLINK-40168][table] Thread the EARLY_FIRE hint into the interval join#28796

Draft
weiqingy wants to merge 6 commits into
apache:masterfrom
weiqingy:FLINK-36953-pr1b-thread
Draft

[FLINK-40168][table] Thread the EARLY_FIRE hint into the interval join#28796
weiqingy wants to merge 6 commits into
apache:masterfrom
weiqingy:FLINK-36953-pr1b-thread

Conversation

@weiqingy

@weiqingy weiqingy commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Stacked on #28353 (PR-1a). Until #28353 merges, this PR's diff includes PR-1a's commits; I'll rebase onto master once it is merged, after which the diff narrows to just this change.

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)
PR-1b (this PR) 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
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

What is the purpose of the change

Threads the (already-registered) EARLY_FIRE hint through the planner to the ExecNode. StreamPhysicalIntervalJoinRule reads the hint, resolves the effective time mode from the join's time domain, validates the domain combinations, and threads the delay and time mode into StreamExecIntervalJoin as NON_NULL JSON fields. The operator receives the parameters but ignores them; runtime behavior lands in PR-4.

Brief change log

  • StreamPhysicalIntervalJoinRule reads the hint, resolves the effective time mode, rejects row-time triggering on a processing-time join, and rejects (for now) processing-time triggering on an event-time join.
  • Thread earlyFireDelay/earlyFireTimeMode through StreamPhysicalIntervalJoin into StreamExecIntervalJoin as NON_NULL JSON fields.

Verifying this change

This change added tests and can be verified as follows:

  • EarlyFireJoinHintTest: earlyFireDelay/earlyFireTimeMode reach the exec plan for both a row-time (default ROWTIME) and a processing-time (default PROCTIME) interval join; row-time-on-proctime and processing-time-on-rowtime are rejected; a compiled-plan JSON round-trip covers serialization of the new ExecNode fields.

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): no
  • The serializers: yes (compiled-plan ExecNode JSON only; no state serializer change)
  • 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? no (planner threading for the FLIP-497 hint)
  • If yes, how is the feature documented? not applicable

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

Generated-by: Claude Code (Anthropic)

weiqingy added 5 commits July 18, 2026 15:09
…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.
…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.
…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.
@flinkbot

flinkbot commented Jul 22, 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-1b of the FLIP-497 stack ahead as a draft. It's stacked on #28353, so I'll rebase it onto master and take it out of draft for review once #28353 is merged. Thanks!

@RocMarshal RocMarshal self-assigned this Jul 22, 2026
@weiqingy
weiqingy force-pushed the FLINK-36953-pr1b-thread branch from eed5d94 to 96ba48f Compare July 22, 2026 04:57
@weiqingy
weiqingy force-pushed the FLINK-36953-pr1b-thread branch from 96ba48f to 647116f Compare July 22, 2026 05:10
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.

3 participants