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_r404217025
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
 ##########
 @@ -2219,6 +2207,42 @@ protected void convertFrom(
     }
   }
 
+  private List<String> getFieldAliases(SqlCall asCall) {
+    if (!validator.getConformance().allowAliasUnnestColumns()) {
+      return null;
+    }
+
+    List<String> columnAliases = new ArrayList<>();
+    for (SqlNode sqlNode : Util.skip(asCall.getOperandList(), 2)) {
+      columnAliases.add(((SqlIdentifier) sqlNode).getSimple());
+    }
+    return columnAliases;
+  }
+
+  private void convertUnnest(Blackboard bb, SqlCall from, List<String> 
fieldAliases) {
+    SqlCall call;
+    call = from;
+    final List<SqlNode> nodes = call.getOperandList();
+    final SqlUnnestOperator operator = (SqlUnnestOperator) call.getOperator();
+    for (SqlNode node : nodes) {
+      replaceSubQueries(bb, node, RelOptUtil.Logic.TRUE_FALSE_UNKNOWN);
+    }
+    final List<RexNode> exprs = new ArrayList<>();
+    final List<String> fieldNames = new ArrayList<>();
 
 Review comment:
   you don't need two separate arrays. `RelBuilder.project` will apply aliases 
if you have used `RelBuilder.alias` to wrap expressions in 'as'. Use `project` 
rather than `projectNamed`.

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