Github user mridulm commented on a diff in the pull request:
https://github.com/apache/spark/pull/21102#discussion_r203314045
--- Diff:
core/src/main/scala/org/apache/spark/util/collection/OpenHashSet.scala ---
@@ -163,7 +187,7 @@ class OpenHashSet[@specialized(Long, Int) T: ClassTag](
* to a new position (in the new data array).
*/
def rehashIfNeeded(k: T, allocateFunc: (Int) => Unit, moveFunc: (Int,
Int) => Unit) {
- if (_size > _growThreshold) {
+ if (_occupied > _growThreshold) {
--- End diff --
I dont see any value in _occupied - on contrary it can cause very bad
behavior if there is a lot of remove's expected.
`_size` is a better metric to decide to rehash and grow.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]