sbroeder commented on code in PR #5271:
URL: https://github.com/apache/calcite/pull/5271#discussion_r4579394624


##########
core/src/main/java/org/apache/calcite/sql/validate/AliasNamespace.java:
##########
@@ -162,6 +169,21 @@ protected AliasNamespace(
     }
   }
 
+  /**
+   * Returns whether UNNEST expands the collection's ROW element into one
+   * column per field. Such a column keeps its field name, and the alias
+   * names it as well; any other data column takes the alias as its name.
+   */
+  private boolean keepsElementFieldName(SqlCall unnestCall) {
+    final RelDataType operandType =
+        SqlUnnestOperator.unwrapOperandType(
+            validator.getValidatedNodeType(unnestCall.operand(0)));
+    final RelDataType componentType = operandType.getComponentType();
+    return componentType != null
+        && SqlUnnestOperator.expandsStructIntoColumns(componentType,
+            validator.config().conformance().allowAliasUnnestItems());
+  }

Review Comment:
   Great catch.  Fixed in c0aac8317767b5b85706228ff72c55dc5a492e4f



-- 
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