uros-db commented on code in PR #46597: URL: https://github.com/apache/spark/pull/46597#discussion_r1605132882
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Mode.scala: ########## @@ -41,6 +42,11 @@ case class Mode( this(child, 0, 0, Some(reverse)) } + final lazy val collationId: Int = child.dataType match { + case c: StringType => c.collationId + case _ => CollationFactory.UTF8_BINARY_COLLATION_ID + } Review Comment: I see, child is just Expression in Mode in this case, I would say remove final lazy val collationId (since it's only used in 1 place anyways), and just do pattern matching below -- 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