-
Notifications
You must be signed in to change notification settings - Fork 23
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
Preserve LATERAL UNNEST during SqlNode validation #101
Preserve LATERAL UNNEST during SqlNode validation #101
Conversation
case LATERAL: | ||
// Validate subquery that LATERAL precedes | ||
validateQuery(((SqlCall) node).operand(0), scope, targetRowType); | ||
break; |
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.
This was incorrect, we want to recurse into same function (validateFrom
) and not into validateQuery
.
case LATERAL: | ||
convertFrom(bb, ((SqlCall) from).operand(0)); | ||
return; |
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.
This is needed to work correctly with Coral's HiveSqlToRelConverter class which extends this class and overrides this function.
@KevinGe00 in general (1) lets add the commands used to build & test, especially how to i-test with Coral, in the PR description. it helps build confidence in the changes and it'll be useful for future work as well. (2) Please file the Coral PR and cross reference it here so that reviewers can follow testing done related to |
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
Outdated
Show resolved
Hide resolved
i-testing with Coral can only be done after merging and publishing these changes, then using the newest Calcite version containing these changes in a Coral feature branch in the regression pipeline, same thing done for #98. |
Approving to unblock i-testing. Let's revisit the code changes of this PR during / after the i-testing. |
Summary
This is a follow up to #98, where LATERALs were only preserved during validation if they appeared in the form
... LATERAL (SELECT ....
. This PR induces the preservation behavior also in the.. LATERAL (UNNEST ...
case, this is needed for Coral to produce correct translations on views (see CoralSqlNodeToSparkSqlNodeConverter for details).Testing
./mvnw clean install -Dgpg.skip -f core/pom.xml
./gradlew clean build