AlexisCubilla commented on code in PR #5114:
URL: https://github.com/apache/calcite/pull/5114#discussion_r3622477219
##########
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java:
##########
@@ -297,6 +296,24 @@ protected SqlCall as(SqlNode e, String alias, String...
fieldNames) {
return SqlStdOperatorTable.AS.createCall(POS, operandList);
}
+ /** Wraps a column reference produced while expanding {@code SELECT *} in an
+ * {@code AS} alias when the column's intrinsic name differs from the
+ * (unique) row-type field name. Without this, a sub-query that wraps a join
+ * with duplicate field names (e.g. two columns named {@code DEPTNO}) would
+ * expose two identically named columns, which is ambiguous when referenced
+ * from an outer query.
+ *
+ * <p>See <a href="https://issues.apache.org/jira/browse/CALCITE-7663">
+ * [CALCITE-7663]</a>. */
+ private SqlNode expandedField(SqlNode fieldNode, String uniqueName) {
Review Comment:
Thanks for the review! Addressed all three points:
- Renamed the method to renameAs.
- Removed the issue reference from the method comment.
- Moved the note about duplicate field names to the call sites where
renameAs is used.
--
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]