guestli commented on code in PR #3375:
URL: https://github.com/apache/calcite/pull/3375#discussion_r1299165245


##########
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java:
##########
@@ -261,9 +263,24 @@ protected SqlCall as(SqlNode e, String alias, String... 
fieldNames) {
 
   /** Returns whether a list of expressions projects all fields, in order,
    * from the input, with the same names. */
-  public static boolean isStar(List<RexNode> exps, RelDataType inputRowType,
+  public static boolean isStar(List<RexNode> exps, RelNode input,
       RelDataType projectRowType) {
     assert exps.size() == projectRowType.getFieldCount();
+    // Duplicate column names
+    // For example, EMP JOIN DEPT, both of which have columns named DEPTNO
+    if (input instanceof Join || input instanceof MultiJoin) {

Review Comment:
   @JiajunBernoulli Thank you for your advice. I've considered adding a method 
before, but it might still cause an error when the isStar method is called from 
somewhere else. If the method name of 'isStar' is changed to something like 
'projectAllField', `!projectAllField() && ! isJoinDuplicateName()` would that 
be better?
   If you insist that the method name not be changed, I will also take your 
advice.



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