HyukjinKwon commented on code in PR #41419: URL: https://github.com/apache/spark/pull/41419#discussion_r1213963275
########## sql/core/src/main/scala/org/apache/spark/sql/execution/SubqueryBroadcastExec.scala: ########## @@ -93,7 +94,9 @@ case class SubqueryBroadcastExec( val rows = if (broadcastRelation.keyIsUnique) { keyIter.toArray[InternalRow] } else { - keyIter.toArray[InternalRow].distinct + val set = new HashSet[InternalRow]() + keyIter.foreach(set.add(_)) + set.toArray[InternalRow] Review Comment: Can we just: ```scala keyIter.toStream.distinct.toArray[InternalRow] ``` ? -- 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