hvanhovell commented on a change in pull request #28351:
URL: https://github.com/apache/spark/pull/28351#discussion_r415776330



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/collect.scala
##########
@@ -139,6 +139,23 @@ case class CollectSet(
 
   def this(child: Expression) = this(child, 0, 0)
 
+  override def eval(buffer: mutable.HashSet[Any]): Any = {

Review comment:
       I don't think this is how we should fix this. `eval(..)` is called super 
late in the game, and all that time we are keeping duplicates in memory and we 
are shuffling them. How about converting binary to an `UnsafeArrayData` object 
in `update()`? `UnsafeArrayData` has a decent `equals` and `hashCode` 
implementation so that should work. You will need to convert them back in eval.




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

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