GideonPotok commented on code in PR #47154: URL: https://github.com/apache/spark/pull/47154#discussion_r1687925942
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Mode.scala: ########## @@ -86,6 +71,77 @@ case class Mode( buffer } + private def recursivelyGetBufferForArrayType( + a: ArrayType, + data: ArrayData): Seq[Any] = { + (0 until data.numElements()).map { i => + data.get(i, a.elementType) match { + case k: UTF8String if !UnsafeRowUtils.isBinaryStable(a.elementType) + => CollationFactory.getCollationKey(k, a.elementType.asInstanceOf[StringType].collationId) Review Comment: the Array Type a has an element type which could be anything, including a StringType. In the case of array<string collate ...>, a.elementType would be StringType ![image](https://github.com/user-attachments/assets/2f327cda-9a39-4de4-9423-3221076d0fd1) -- 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