zzwqqq commented on code in PR #5077:
URL: https://github.com/apache/calcite/pull/5077#discussion_r3556668358


##########
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java:
##########
@@ -275,13 +277,36 @@ public abstract Result visitInput(RelNode e, int i, 
boolean anon,
   public void addSelect(List<SqlNode> selectList, SqlNode node,
       RelDataType rowType) {
     String name = rowType.getFieldNames().get(selectList.size());
+    addSelect(selectList, node, name);
+  }
+
+  private void addSelect(List<SqlNode> selectList, SqlNode node,
+      String name) {
     @Nullable String alias = SqlValidatorUtil.alias(node);
     if (alias == null || !alias.equals(name)) {
       node = as(node, name);
     }
     selectList.add(node);
   }
 
+  /** Returns field names to use when a result is wrapped as a derived table. 
*/
+  protected List<String> derivedTableFieldNames(RelDataType rowType) {
+    return rowType.getFieldNames();
+  }
+
+  /** Returns a copy of a row type with different field names. */
+  private static RelDataType renameRowTypeFields(RelDataType rowType,

Review Comment:
   I considered moving it, but it is currently only used by `SqlImplementor` to 
track rewritten field aliases. I kept it local to avoid adding a 
`RelRecordType` method for a single use, but I can move it if you prefer.



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