GideonPotok commented on code in PR #47154:
URL: https://github.com/apache/spark/pull/47154#discussion_r1677789334


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Mode.scala:
##########
@@ -106,11 +155,13 @@ case class Mode(
     val collationAwareBuffer = child.dataType match {
       case c: StringType if
         !CollationFactory.fetchCollation(c.collationId).supportsBinaryEquality 
=>
-        val collationId = c.collationId
-        val modeMap = buffer.toSeq.groupMapReduce {
-         case (k, _) => 
CollationFactory.getCollationKey(k.asInstanceOf[UTF8String], collationId)
+        buffer.toSeq.groupMapReduce {
+         case (k, _) => 
CollationFactory.getCollationKey(k.asInstanceOf[UTF8String], c.collationId)
         }(x => x)((x, y) => (x._1, x._2 + y._2)).values
-        modeMap
+      case _: ArrayType | _ : StructType if child.dataType.existsRecursively(s 
=>

Review Comment:
   @uros-db Yes, `Mode` supports all data types. 
   
   Has it been determined whether MapType will be made to support collations? 
   
   <img width="387" alt="image" 
src="https://github.com/user-attachments/assets/fc8fe896-fa2d-49db-8293-5ceeaa7936d1";>
    



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to