Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/6763#discussion_r32269759
--- Diff:
core/src/main/scala/org/apache/spark/util/collection/OpenHashSet.scala ---
@@ -278,7 +279,7 @@ object OpenHashSet {
val INVALID_POS = -1
val NONEXISTENCE_MASK = 0x80000000
- val POSITION_MASK = 0xEFFFFFF
+ val POSITION_MASK = 0x1FFFFFFF
--- End diff --
I think you're right that this is a subtle but important bug, but it looks
like the intent is to use all but the top bit. That's 0x7FFFFFFF not
0x1FFFFFFF. Therefore the max position and size is 2^31-1, not 2^29, and that's
already the max value of an int, so I don't think the check is needed. Well you
could check for a negative value. Basically it's reusing the sign bit that
would never otherwise be used since position and size must be positive.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]