You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2021/12/21 14:21:49 UTC

[GitHub] [calcite] alex-plekhanov commented on a change in pull request #2631: [CALCITE-4915] Query with unqualified common column and NATURAL JOIN fails

alex-plekhanov commented on a change in pull request #2631:
URL: https://github.com/apache/calcite/pull/2631#discussion_r773176036



##########
File path: core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
##########
@@ -466,14 +466,14 @@ private boolean expandSelectItem(
     return false;
   }
 
-  private static SqlNode expandExprFromJoin(SqlJoin join, SqlIdentifier identifier,
+  private SqlNode expandExprFromJoin(SqlJoin join, SqlIdentifier identifier,
       @Nullable SelectScope scope) {
-    if (join.getConditionType() != JoinConditionType.USING) {
+    if (join.getConditionType() != JoinConditionType.USING && !join.isNatural()) {
       return identifier;
     }
 
     for (String name
-        : SqlIdentifier.simpleNames((SqlNodeList) getCondition(join))) {
+        : requireNonNull(usingNames(join), () -> "usingNames for " + join)) {

Review comment:
       Fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org