cboumalh commented on code in PR #52316:
URL: https://github.com/apache/spark/pull/52316#discussion_r2347028916


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/datasketchesAggregates.scala:
##########
@@ -146,8 +151,11 @@ case class HllSketchAgg(
         case IntegerType => sketch.update(v.asInstanceOf[Int])
         case LongType => sketch.update(v.asInstanceOf[Long])
         case st: StringType =>
-          val cKey = 
CollationFactory.getCollationKey(v.asInstanceOf[UTF8String], st.collationId)
-          sketch.update(cKey.toString)
+          val str = v.asInstanceOf[UTF8String]
+          if (str != null && str.numBytes > 0) {
+            val cKey = CollationFactory.getCollationKeyBytes(str, 
st.collationId)
+            sketch.update(cKey)
+          }

Review Comment:
   I see, my fork is probably not up to date that is why. I will update this 
when I get the chance. Thank you for the guidance.



-- 
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

Reply via email to