[CALCITE-7732] Make the TABLE keyword optional for table function calls in LATERAL context - #5214
Open
darpan-14 wants to merge 1 commit into
Open
[CALCITE-7732] Make the TABLE keyword optional for table function calls in LATERAL context#5214darpan-14 wants to merge 1 commit into
darpan-14 wants to merge 1 commit into
Conversation
mihaibudiu
reviewed
Aug 24, 2026
|
|
||
| // Detect LATERAL function(...) without adding a multi-token JavaCC | ||
| // lookahead sequence to parse errors for existing LATERAL syntax. | ||
| private boolean isLateralImplicitTableFunctionAhead() { |
Contributor
There was a problem hiding this comment.
I am not crazy about this function. Is there a simpler way to do it, maybe by refactoring the grammar a bit?
Author
There was a problem hiding this comment.
Thanks for the review, have updated the implementation. Could you please check again?
mihaibudiu
approved these changes
Aug 25, 2026
Contributor
|
This is much better; please squash the commits for merging |
…ls in LATERAL context
darpan-14
force-pushed
the
CALCITE-7732
branch
from
August 26, 2026 05:58
a6adda1 to
321a6af
Compare
Author
|
Thanks @mihaibudiu , have updated commit message as well as PR title according to convention. |
|
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.



Jira Link
CALCITE-7732
Changes Proposed
Calcite allows table functions in the
FROMclause without theTABLE(...)wrapper:
However, explicitly specifying
LATERALcurrently makes the wrapper mandatory:This change makes
TABLEoptional in that context, allowing:The existing wrapped syntax remains supported and unchanged.
The parser recognizes unqualified and schema-qualified function names and
constructs the same
LATERALandCOLLECTION_TABLEparse tree used by thewrapped form. Existing handling of
LATERAL TABLE(...),LATERAL UNNEST(...),and lateral subqueries remains unchanged.