Skip to content

[FLINK-39420] Reject temporal joins in batch mode with a clear error#27912

Open
jnh5y wants to merge 1 commit intoapache:masterfrom
jnh5y:FLINK-39420-reject-temporal-join-batch
Open

[FLINK-39420] Reject temporal joins in batch mode with a clear error#27912
jnh5y wants to merge 1 commit intoapache:masterfrom
jnh5y:FLINK-39420-reject-temporal-join-batch

Conversation

@jnh5y
Copy link
Copy Markdown
Contributor

@jnh5y jnh5y commented Apr 10, 2026

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

  • Added RejectTemporalJoinInBatchRule to the batch EXPAND_PLAN_RULES — unconditionally rejects any LogicalCorrelate + LogicalSnapshot remaining after lookup join rules fire
  • Registered WITH_FILTER and WITHOUT_FILTER variants in FlinkBatchRuleSets

Verifying this change

This change is already covered by existing tests, such as TemporalJoinTest (batch) which already asserted that a TableException is thrown. The tests now additionally verify the specific error message from RejectTemporalJoinInBatchRule. Batch LookupJoinTest (19 tests) confirms lookup joins are unaffected. Streaming TemporalJoinTest (24 tests) confirms no regression.

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: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

Generated-by: Claude Opus 4.6 (1M context) noreply@anthropic.com

@flinkbot
Copy link
Copy Markdown
Collaborator

flinkbot commented Apr 10, 2026

CI report:

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

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>
@jnh5y jnh5y force-pushed the FLINK-39420-reject-temporal-join-batch branch from ceedbda to d135c78 Compare April 10, 2026 15:25
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