[FLINK-39420] Reject temporal joins in batch mode with a clear error#27912
Open
jnh5y wants to merge 1 commit intoapache:masterfrom
Open
[FLINK-39420] Reject temporal joins in batch mode with a clear error#27912jnh5y wants to merge 1 commit intoapache:masterfrom
jnh5y wants to merge 1 commit intoapache:masterfrom
Conversation
Collaborator
Batch mode only supports lookup joins. General temporal joins (event-time or processing-time on non-lookup sources) previously left an unresolved LogicalCorrelate in the plan, causing a confusing "unexpected correlate variable" error from FlinkDecorrelateProgram. Add RejectTemporalJoinInBatchRule to the batch EXPAND_PLAN_RULES. The lookup join rules fire first and rewrite valid lookup joins; any remaining Correlate+Snapshot pattern is unconditionally rejected with an actionable message pointing users to lookup joins or streaming mode. Generated-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ceedbda to
d135c78
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.
What is the purpose of the change
Batch mode only supports lookup joins. General temporal joins (event-time or processing-time on non-lookup sources) previously left an unresolved LogicalCorrelate in the plan, causing a confusing "unexpected correlate variable" error from FlinkDecorrelateProgram.
Add RejectTemporalJoinInBatchRule to the batch EXPAND_PLAN_RULES. The lookup join rules fire first and rewrite valid lookup joins; any remaining Correlate+Snapshot pattern is unconditionally rejected with an actionable message pointing users to lookup joins or streaming mode.
Brief change log
RejectTemporalJoinInBatchRuleto the batchEXPAND_PLAN_RULES— unconditionally rejects anyLogicalCorrelate+LogicalSnapshotremaining after lookup join rules fireWITH_FILTERandWITHOUT_FILTERvariants inFlinkBatchRuleSetsVerifying this change
This change is already covered by existing tests, such as
TemporalJoinTest(batch) which already asserted that aTableExceptionis thrown. The tests now additionally verify the specific error message fromRejectTemporalJoinInBatchRule. BatchLookupJoinTest(19 tests) confirms lookup joins are unaffected. StreamingTemporalJoinTest(24 tests) confirms no regression.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Generated-by: Claude Opus 4.6 (1M context) noreply@anthropic.com