Uh oh!
There was an error while loading. Please reload this page.
[SPARK-23381][CORE] Murmur3 hash generates a different value from other implementations - #20568
[SPARK-23381][CORE] Murmur3 hash generates a different value from other implementations#20568mrkm4ntr wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
It would be good to add JIRA number with a short description as a comment (e.g. SPARK-23381 ...)
There was a problem hiding this comment.
Is it better to compare with the result of murmur3 hash value by scala library?
mrkm4ntr
commented
Feb 11, 2018
@kiszk Thank you for your review! I fixed it. |
@mrkm4ntr The change itself looks pretty reasonable. However I am very hesitant to merge this because this will probably break bucketing (it uses murmur3 to create the buckets); for example a bucketed table written by Spark 2.2 cannot be safely read by Spark after this change. Can you explain what problem you are trying to fix here? |
mrkm4ntr
commented
Feb 13, 2018
@hvanhovell The main motivation is making the online prediction of trained parameters using FeatureHasher in MLLib. If the generated hash value is different from the implementations in another language, indices of coefficients do not match and can not predict correctly. |
jiangxb1987
commented
Feb 14, 2018
How about add a new config to control whether to use the new Murmur3 hash function and have that default turned off? We also have to document the change explicitly. WDYT @gatorsmile@hvanhovell@cloud-fan ? |
hvanhovell
commented
Feb 14, 2018
@mrkm4ntr I see your point. Adding a method to Murmur3 would work. The problem is that we are now going to release a cc @sameeragarwal@srowen for more visibility. |
mrkm4ntr
commented
Feb 14, 2018
@hvanhovell I sent an e-mail to the topic |
mrkm4ntr
commented
Feb 15, 2018
@hvanhovell I added a method and changed it so that we call it only from FeatureHasher. |
felixcheung
commented
Feb 15, 2018
Jenkins, test this please |
SparkQA
commented
Feb 15, 2018
Test build #87472 has finished for PR 20568 at commit
|
There was a problem hiding this comment.
nit: Use this method for new components after Spark 2.3
kiszk
commented
Feb 15, 2018
Retest this please |
…not a multiple of 4
mrkm4ntr
commented
Feb 16, 2018
I cannot reproduce this failure of the test in my environment. |
kiszk
commented
Feb 16, 2018
@mrkm4ntr Do not worry about these failures. Since we know there are some unstable tests, our community is trying to fix them. For a while, we have to kick test. |
kiszk
commented
Feb 16, 2018
Retest this please |
ueshin
commented
Feb 16, 2018
Jenkins, retest this please. |
SparkQA
commented
Feb 16, 2018
Test build #87501 has finished for PR 20568 at commit
|
kiszk
commented
Feb 16, 2018
Jenkins, retest this please. |
viirya
commented
Feb 16, 2018
retest this please. |
| * See SPARK-23381. | ||
| */ | ||
| @Since("2.3.0") | ||
| def murmur3Hash(term: Any): Int = { |
There was a problem hiding this comment.
I would also address this comment.
felixcheung
commented
Feb 16, 2018
Jenkins, retest this please. |
SparkQA
commented
Feb 16, 2018
Test build #87509 has finished for PR 20568 at commit
|
kiszk
commented
Feb 16, 2018
Jenkins, retest this please. |
hvanhovell
commented
Feb 16, 2018
@mrkm4ntr this is legitimate failure. Can you fix the python tests? |
sameeragarwal
commented
Feb 16, 2018
@hvanhovell just to make sure, given the dependency on |
(updated) For ML, I actually don't think this has to be a blocker. It's not great, but it's not a regression. However, we should definitely fix this in the future and soon: For ML, it's really important that MurmurHash3 behave consistently across platforms. To fix this, we'll need to maintain the old implementation of MurmushHash3 to maintain the behavior of ML Pipelines exported from previous versions of Spark. |
gatorsmile
commented
Feb 16, 2018
gatorsmile
commented
Feb 16, 2018
Submitted the PR #20630 to take this over. |
viirya
commented
Feb 17, 2018
I think we can close this now. |
gatorsmile
commented
Feb 17, 2018
@mrkm4ntr Thank you for your contribution! The PR has been merged using your Github account. Could you close this? |
mrkm4ntr
commented
Feb 17, 2018
@gatorsmile Thanks! I will close it. |
What changes were proposed in this pull request?
Murmur3 hash generates a different value from the original and other implementations (like Scala standard library and Guava or so) when the length of a bytes array is not multiple of 4.
How was this patch tested?
Added a unit test.
Please review http://spark.apache.org/contributing.html before opening a pull request.