-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-25249][CORE][TEST]add a unit test for OpenHashMap #22241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do these tests mean? Tests for different type comparisons? e.g.,
assert(!Some(specializedMap1("a")).contains(0.0))
assert(!Some(specializedMap1("b")).contains(0.toShort))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the data type is in @specialized annotation , and the key is not be contained ,the map(key) will return 0
if the data type is not in @specialized annotation , and the key is not be contained ,the map(key) will return null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I see. So, can you describe more in the description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok , i will add it
|
plz add |
|
thanks @maropu |
|
Test build #95282 has finished for PR 22241 at commit
|
|
Test build #95285 has finished for PR 22241 at commit
|
|
Adding tests looks good. |
|
@kiszk I guess it's because in this case the underlying value type is a primitive like int or long, so null can't be returned? |
|
Merged to master |
|
Test build #95286 has finished for PR 22241 at commit
|
## What changes were proposed in this pull request? This PR adds a unit test for OpenHashMap , this can help developers to distinguish between the 0/0.0/0L and null ## How was this patch tested? Closes apache#22241 from 10110346/openhashmap. Authored-by: liuxian <[email protected]> Signed-off-by: Sean Owen <[email protected]>
What changes were proposed in this pull request?
This PR adds a unit test for OpenHashMap , this can help developers to distinguish between the 0/0.0/0L and null
How was this patch tested?