mihaibudiu commented on code in PR #3802:
URL: https://github.com/apache/calcite/pull/3802#discussion_r1640158152


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -736,7 +737,7 @@ private boolean expandStar(List<SqlNode> selectItems, 
Set<String> aliases,
       if (!hasDynamicStruct || Bug.CALCITE_2400_FIXED) {
         // If some fields before star identifier,
         // we should move offset.
-        int offset = calculatePermuteOffset(selectItems);
+        int offset = Math.min(calculatePermuteOffset(selectItems), 
originalSize);

Review Comment:
   My question was whether the `|| Bug.CALCITE_2400_FIXED` is still needed 
after your fix.



-- 
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: commits-unsubscr...@calcite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to