GideonPotok commented on code in PR #46917: URL: https://github.com/apache/spark/pull/46917#discussion_r1635144201
########## core/src/main/scala/org/apache/spark/util/collection/OpenHashSet.scala: ########## @@ -118,8 +125,21 @@ class OpenHashSet[@specialized(Long, Int, Double, Float) T: ClassTag]( * See: https://issues.apache.org/jira/browse/SPARK-45599 */ @annotation.nowarn("cat=other-non-cooperative-equals") - private def keyExistsAtPos(k: T, pos: Int) = - _data(pos) equals k + protected def keyExistsAtPos(k: T, pos: Int) = { + classTag[T] match { + case ClassTag.Long => _data(pos) equals k + case ClassTag.Int => _data(pos) equals k + case ClassTag.Double => _data(pos) equals k + case ClassTag.Float => _data(pos) equals k + case _ => nonClassTagKeyExistsAtPos(k, _data(pos)) + + } + } + + @annotation.nowarn("cat=other-non-cooperative-equals") + protected def nonClassTagKeyExistsAtPos(k: T, dataAtPos: T): Boolean = { + dataAtPos equals k + } Review Comment: @uros-db please see comment above and let me know if we are on the same page -- 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