-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-38493][table] Port Calcite's fix for LATERAL is lost while validation #27096
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?
Conversation
9a2c0ca
to
78d281f
Compare
) | ||
AS SELECT * | ||
FROM `default_catalog`.`default_database`.`orders` | ||
AS SELECT `orders`.`user`, `orders`.`product`, `orders`.`amount`, `orders`.`ts`, `orders`.`ptime` |
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.
since now validated query is used, star is expanded
@snuyanzin I think the PR title should be LATERAL not LITERAL |
yep, you are right, thank you, changed PR description |
// the issue was resolved in CALCITE-4077 | ||
// (always treat the table function as implicitly LATERAL). | ||
String expandedQuery = context.expandSqlIdentifiers(originalQuery); | ||
String expandedQuery = context.toQuotedSqlString(query); |
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.
Do we know how long this has been in place? It seems like a fundamental change to me?
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.
seems more than 5 years...
we can go in a bit lighter way: apply this only for materialized tables and leave old behavior for views
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.
Ok but it was in place for some years before 2020? So LATERAL was the only problem. I like the expansion behavior, I just want to make sure that we are not breaking views.
What is the purpose of the change
The problem is CALCITE-7217 where
LATERAL
is lost while validationthe issue appeared after CALCITE-4077 (Calcite 1.24) and there are several places in Flink code with WAs
The PR is to have it fixed
Brief change log
Calcite classes and tests
Verifying this change
View and MaterializedTable related tests
especially test with
LATERAL
for materialized tablesflink/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/operations/SqlMaterializedTableNodeToOperationConverterTest.java
Line 158 in 47478ed
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation