zzwqqq commented on code in PR #5077:
URL: https://github.com/apache/calcite/pull/5077#discussion_r3556615724
##########
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) {
Review Comment:
Thanks for reviewing. I removed it. `SqlImplementor` already has access to
the dialect, so the extra hook was not needed. `forDerivedTable` now uniquifies
the field names directly.
--
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]