mihailotim-db commented on code in PR #50606: URL: https://github.com/apache/spark/pull/50606#discussion_r2048369191
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala: ########## @@ -6532,12 +6547,12 @@ class AstBuilder extends DataTypeAstBuilder case n: NamedExpression => newGroupingExpressions += n newAggregateExpressions += n - // If the grouping expression is an integer literal, create [[UnresolvedOrdinal]] and - // [[UnresolvedPipeAggregateOrdinal]] expressions to represent it in the final grouping - // and aggregate expressions, respectively. This will let the + // If the grouping expression is an [[UnresolvedOrdinal]], replace the ordinal value and + // create [[UnresolvedPipeAggregateOrdinal]] expressions to represent it in the final + // grouping and aggregate expressions, respectively. This will let the // [[ResolveOrdinalInOrderByAndGroupBy]] rule detect the ordinal in the aggregate list // and replace it with the corresponding attribute from the child operator. - case Literal(v: Int, IntegerType) if conf.groupByOrdinal => + case UnresolvedOrdinal(v: Int) => newGroupingExpressions += UnresolvedOrdinal(newAggregateExpressions.length + 1) Review Comment: Thanks for the clarification! -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org