[FLINK-40170][table-planner] Infer update-producing changelog mode for early-fire interval join - #3
Draft
weiqingy wants to merge 1 commit into
Draft
Conversation
weiqingy
force-pushed
the
FLINK-36953-pr3-changelog
branch
from
July 18, 2026 22:12
f6163da to
16ae7d2
Compare
weiqingy
force-pushed
the
FLINK-36953-pr2-target
branch
from
July 18, 2026 22:12
0b76a4b to
dc1e210
Compare
weiqingy
force-pushed
the
FLINK-36953-pr3-changelog
branch
from
July 21, 2026 02:17
16ae7d2 to
17d607b
Compare
weiqingy
force-pushed
the
FLINK-36953-pr2-target
branch
2 times, most recently
from
July 21, 2026 04:43
2d8840b to
8000ad1
Compare
weiqingy
force-pushed
the
FLINK-36953-pr3-changelog
branch
from
July 21, 2026 04:43
17d607b to
9dbe90d
Compare
weiqingy
force-pushed
the
FLINK-36953-pr2-target
branch
2 times, most recently
from
August 2, 2026 22:18
0ef163a to
3b14d56
Compare
…fire interval join With the EARLY_FIRE hint, an outer interval join speculatively emits a padded unmatched row after the delay and corrects it when a match later arrives, so it no longer produces insert-only changes. Teach FlinkChangelogModeInferenceProgram to reflect this. Split StreamPhysicalIntervalJoin into its own ModifyKindSet arm: its children still consume insert-only, but the node provides INSERT and, when the hint makes it update-producing, UPDATE. A new produceEarlyFireUpdates accessor gates that on the hint being set, the join being outer, and a non-negative window span, so the hint stays inert for inner joins and negative-window joins (which only ever emit inserts). The interval join keeps its place in the UpdateKind and DeleteKind arms. When such a join feeds an insert-only downstream, planning fails with a tailored error that names the hint, rather than the generic "doesn't support consuming update changes" message. Runtime behavior is unchanged; the operator still ignores the hint. The compiled-plan round-trip test's sink now declares sink-insert-only=false: its early-fire outer join produces updates under the new inference, so the previously insert-only sink no longer accepts the pipeline.
weiqingy
force-pushed
the
FLINK-36953-pr3-changelog
branch
from
August 2, 2026 22:42
9dbe90d to
8f7448f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the FLIP-497 stack under umbrella FLINK-36953. Stacked on PR-2. Landing order: PR-1a → PR-1b → PR-2 → PR-3 (this) → PR-4 → PR-5 → PR-6 → PR-7.
What is the purpose of the change
When
EARLY_FIREis set on an outer interval join, the join emits a speculative null-padded row and later corrects it — an updating result. This PR makes the planner infer that update-producing changelog mode and reject an insert-only downstream with a tailored error. Inner joins and negative-window joins remain append-only.Brief change log
FlinkChangelogModeInferenceProgram(SatisfyModifyKindSetTraitVisitor): early-fire + outer join + non-negative window ⇒INSERT,UPDATE; otherwiseINSERT_ONLY.TableExceptionwhen such an updating early-fire interval join feeds an insert-only sink.StreamPhysicalIntervalJoinforwards the trait.Verifying this change
This change added tests and can be verified as follows:
IntervalJoinTestplan/changelog cases: early-fire outer join is update-producing; insert-only-downstream throws the tailored error; negative-window + early-fire and inner + early-fire stayINSERT_ONLY.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Anthropic)