-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[FLINK-39780] Make TABLE keyword optional in LATERAL context #28276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -316,7 +316,8 @@ tableReference: | |||||
|
|
||||||
| tablePrimary: | ||||||
| [ TABLE ] tablePath [ dynamicTableOptions ] [systemTimePeriod] [[AS] correlationName] | ||||||
| | LATERAL TABLE '(' functionName '(' expression [, expression ]* ')' ')' | ||||||
| | [ LATERAL ] functionName '(' expression [, expression ]* ')' | ||||||
| | [ LATERAL ] TABLE '(' functionName '(' expression [, expression ]* ')' ')' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If table is optional
Suggested change
|
||||||
| | [ LATERAL ] '(' query ')' | ||||||
| | UNNEST '(' expression ')' | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -316,7 +316,8 @@ tableReference: | |||||
|
|
||||||
| tablePrimary: | ||||||
| [ TABLE ] tablePath [ dynamicTableOptions ] [systemTimePeriod] [[AS] correlationName] | ||||||
| | LATERAL TABLE '(' functionName '(' expression [, expression ]* ')' ')' | ||||||
| | [ LATERAL ] functionName '(' expression [, expression ]* ')' | ||||||
| | [ LATERAL ] TABLE '(' functionName '(' expression [, expression ]* ')' ')' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| | [ LATERAL ] '(' query ')' | ||||||
| | UNNEST '(' expression ')' | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2236,6 +2236,16 @@ SqlNode TableRef3(ExprContext exprContext, boolean lateral) : | |
| { | ||
| tableRef = unnestOp.createCall(s.end(this), (List<SqlNode>) args); | ||
| } | ||
| | | ||
| // LATERAL with implicit table function call syntax, | ||
| // e.g. "FROM t, LATERAL fn(...)" instead of "FROM t, LATERAL TABLE(fn(...))". | ||
| // The non-LATERAL implicit form is handled by the CompoundTableIdentifier | ||
| // branch above. | ||
| LOOKAHEAD(2) | ||
| <LATERAL> { lateral = true; } | ||
| tableName = CompoundTableIdentifier() | ||
| tableRef = ImplicitTableFunctionCallArgs(tableName) | ||
| tableRef = addLateral(tableRef, lateral) | ||
|
Comment on lines
+2239
to
+2248
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the Calcite file from https://github.com/apache/calcite/blob/main/core/src/main/codegen/templates/Parser.jj The only reason we have it here is a number of backports from Calcite. In case we need to make changes here: ideally first need to make them in Calcite and then backport here
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally this file should be removed once we update Calcite to versions containing all the backports
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree this is danger zone |
||
| | | ||
| [ <LATERAL> { lateral = true; } ] | ||
| tableRef = TableFunctionCall() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAK we only add the english text as place holder and let folks translate it to Chinese