You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dbatomic (via GitHub)" <gi...@apache.org> on 2024/03/01 11:16:26 UTC

Re: [PR] [SPARK-46834][SQL][Collations] Support for aggregates [spark]

dbatomic commented on code in PR #45290:
URL: https://github.com/apache/spark/pull/45290#discussion_r1508848081


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashMapGenerator.scala:
##########
@@ -173,7 +173,10 @@ abstract class HashMapGenerator(
             ${hashBytes(bytes)}
           """
         }
-      case _: StringType => hashBytes(s"$input.getBytes()")
+      case StringType => hashBytes(s"$input.getBytes()")
+      case st: StringType =>
+        hashLong(s"CollationFactory.fetchCollation(${st.collationId})" +

Review Comment:
   I did some refactoring here. Please take a look. I kept pattern matching but I think it looks a bit nicer now.



-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org