uros-db commented on code in PR #46404: URL: https://github.com/apache/spark/pull/46404#discussion_r1592830626
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Mode.scala: ########## @@ -162,10 +196,10 @@ object ModeBuilder extends ExpressionBuilder { override def build(funcName: String, expressions: Seq[Expression]): Expression = { val numArgs = expressions.length if (numArgs == 0) { - Mode(UnresolvedWithinGroup) + Mode(UnresolvedWithinGroup, collationEnabled = SQLConf.get.collationEnabled) } else if (numArgs == 1) { // For compatibility with function calls without WITHIN GROUP. - Mode(expressions(0)) + Mode(expressions(0), collationEnabled = SQLConf.get.collationEnabled) Review Comment: I think we generally don't branch expression instantiation based on the "collationEnabled" flag the idea is usually to take the collationId from the string arguments (children), and use something like `supportsBinaryEquality` to branch execution in order to preserve original performance for UTF8_BINARY -- 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