Conversation
Collaborator
Enable Table.joinLateral / leftOuterJoinLateral with a call("SNAPSHOT", ...)
build side, producing the same plan as the equivalent SQL.
Release note: The LATERAL SNAPSHOT join can now be expressed through the
programmatic Table API, not just SQL, via Table.joinLateral /
Table.leftOuterJoinLateral with a call("SNAPSHOT", ...) build side.
Generated-by: Claude Code (Claude Opus 4.8)
…OT join Verifies that the Table API surface produces the same optimized physical plan as the equivalent SQL in batch mode, where the join degenerates to a regular join. Generated-by: Claude Code (Claude Opus 4.8)
Add a Lateral Snapshot Join subsection to the Table API joins documentation (English and Chinese) with a Java example; Scala and Python are marked as not supported. Generated-by: Claude Code (Claude Opus 4.8)
airlock-confluentinc
Bot
force-pushed
the
fhueske-FLINK-40885-Add-LSJ-to-TableAPI
branch
from
October 2, 2026 15:52
c7b880c to
7993432
Compare
Contributor
Author
|
@flinkbot run azure |
snuyanzin
reviewed
Oct 2, 2026
| correlatedFunction.getResolvedFunction(), args, inputs, outputType); | ||
| } | ||
|
|
||
| private boolean isSnapshot(FunctionDefinition definition) { |
Contributor
There was a problem hiding this comment.
there is existing LateralSnapshotJoinUtil.isSnapshotFunction
is there a reason we don't reuse it?
snuyanzin
reviewed
Oct 2, 2026
| if (!isFunctionOfKind(children.get(0), FunctionKind.TABLE)) { | ||
| // SNAPSHOT is PROCESS_TABLE rather than TABLE but is valid in a LATERAL join. | ||
| Expression firstChild = children.get(0); | ||
| if (!isFunctionOfKind(children.get(0), FunctionKind.TABLE) |
Contributor
There was a problem hiding this comment.
Suggested change
| if (!isFunctionOfKind(children.get(0), FunctionKind.TABLE) | |
| if (!isFunctionOfKind(firstChild, FunctionKind.TABLE) |
?
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
Enable the
LATERAL SNAPSHOTprocessing-time temporal join to be expressed through the programmatic Table API (Table.joinLateral/Table.leftOuterJoinLateralwith acall("SNAPSHOT", …)build side), not just SQL. The Table API surface produces the same optimized plan and operator (StreamExecLateralSnapshotJoin) as the equivalent SQL.Brief changelog
QueryOperationConverter: convert a SNAPSHOTTABLEargument into aRexTableArgCall+ scan input and emit a plainLogicalJoin(not aCorrelate) soLogicalJoinToLateralSnapshotJoinRulematches, incl. INNER joins; deduplicate the table-argument conversion shared with the FROM-clause PTF path.JoinOperationFactory: allow an ON predicate for a lateral SNAPSHOT join and require an equi-join predicate (reject always-true/empty ON with a clear error).CorrelatedFunctionTableFactory: accept.as(...)aliasing on SNAPSHOT (aPROCESS_TABLEfunction).METADATA VIRTUALrowtime across column-expansion strategies); Table API validation negatives as unit tests; execution smokes; plus matching SQL coverage for the metadata-rowtime case.Adding docs is still to be done. Will update the PR later.
Verifying this change
LateralSnapshotJoinTableApiTest(streaming)— plan-parity + validation negatives (15 tests)LateralSnapshotJoinTableApiTest(batch) — plan-parity with SQLLateralSnapshotJoinSemanticTests— SQL + Table API end-to-end execution smokes (15 tests)LateralSnapshotJoinTest(stream + batch) — SQL plan/golden + negative casesDoes this pull request potentially affect one of the following parts:
@Public(Evolving): yesDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code, Opus 4.8