my7ym commented on a change in pull request #1811: [CALCITE-3789] Support 
validation of UNNEST multiple array columns like Presto
URL: https://github.com/apache/calcite/pull/1811#discussion_r399841003
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/core/Uncollect.java
 ##########
 @@ -130,25 +139,32 @@ public static RelDataType deriveUncollectRowType(RelNode 
rel,
       // Component type is unknown to Uncollect, build a row type with input 
column name
       // and Any type.
       return builder
-          .add(fields.get(0).getName(), SqlTypeName.ANY)
+          .add(requireAlias ? fieldAliases.get(0) : fields.get(0).getName(), 
SqlTypeName.ANY)
           .nullable(true)
           .build();
     }
 
+
+    int aliasIndex = 0;
     for (RelDataTypeField field : fields) {
       if (field.getType() instanceof MapSqlType) {
         builder.add(SqlUnnestOperator.MAP_KEY_COLUMN_NAME, 
field.getType().getKeyType());
         builder.add(SqlUnnestOperator.MAP_VALUE_COLUMN_NAME, 
field.getType().getValueType());
       } else {
 
 Review comment:
   I am also not sure what will be the best way to handle MAP here.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to