GideonPotok commented on code in PR #46404: URL: https://github.com/apache/spark/pull/46404#discussion_r1594756311
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Mode.scala: ########## @@ -70,20 +78,46 @@ case class Mode( buffer } - override def eval(buffer: OpenHashMap[AnyRef, Long]): Any = { - if (buffer.isEmpty) { + override def eval(buff: OpenHashMap[AnyRef, Long]): Any = { + if (buff.isEmpty) { return null } + val buffer = if (child.dataType.isInstanceOf[StringType] && collationEnabled) { + val modeMap = buff.foldLeft( + new TreeMap[org.apache.spark.unsafe.types.UTF8String, Long]()(Ordering.comparatorToOrdering( + CollationFactory.fetchCollation(collationId).comparator Review Comment: Actually, the Numerical benchmark case should be ignored. Thus, For this implementation, the slowdown ranges from 16.9x to 56x. And for the prototype, it ranges from 9.5x to 15x -- 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