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

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/core/Uncollect.java
 ##########
 @@ -46,21 +46,26 @@
 public class Uncollect extends SingleRel {
   public final boolean withOrdinality;
 
+  // To alias the items in Uncollect list, e.g., a, b, c in UNNEST(a, b, c),
+  // instead of fields within a struct field
+  private final List<String> fieldAliases;
+
   //~ Constructors -----------------------------------------------------------
 
   @Deprecated // to be removed before 2.0
   public Uncollect(RelOptCluster cluster, RelTraitSet traitSet,
       RelNode child) {
-    this(cluster, traitSet, child, false);
+    this(cluster, traitSet, child, false, null);
   }
 
   /** Creates an Uncollect.
    *
    * <p>Use {@link #create} unless you know what you're doing. */
   public Uncollect(RelOptCluster cluster, RelTraitSet traitSet, RelNode input,
-      boolean withOrdinality) {
+      boolean withOrdinality, List<String> fieldAliases) {
     super(cluster, traitSet, input);
     this.withOrdinality = withOrdinality;
+    this.fieldAliases = fieldAliases;
 
 Review comment:
   you should copy `fieldAliases` into an immutable list.
   
   Do you think the logic would be more uniform if `fieldAliases` were empty, 
not null, in the usual case? I'm a big fan of empty lists.

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