zinking commented on a change in pull request #2631:
URL: https://github.com/apache/calcite/pull/2631#discussion_r773065284



##########
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:
       er, can this be extracted into a variable? it would be more debug 
friendly




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to