mihaibudiu commented on code in PR #3802: URL: https://github.com/apache/calcite/pull/3802#discussion_r1633816119
########## 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: I see this is gated on CALCITE_2400. What is the relationship between this bug and CALCITE-2400? -- 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