-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-10430][Spark Core]Added hashCode methods in AccumulableInfo and RDDOperationScope #8581
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
ok to test |
test("equals and hashCode") { | ||
val opScope1 = new RDDOperationScope("scope1", id = "1") | ||
val opScope2 = new RDDOperationScope("scope1", id = "1") | ||
assert(opScope1 == opScope2) |
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.
===
Looks good, thanks for fixing this. |
Test build #41961 has finished for PR 8581 at commit
|
Test build #41962 has finished for PR 8581 at commit
|
|
||
override def hashCode(): Int = { | ||
val state = Seq(id, name, update, value, internal) | ||
state.map(_.hashCode).reduce(31 * _ + _) |
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, something just occurred to me: you've been using reduce
here but the operation isn't associative or commutative. I think it has to be reduceLeft
to guarantee the output you want. Maybe update other instances of this in the code (from other PRs) here too?
Test build #41964 has finished for PR 8581 at commit
|
LGTM merging into master thanks. |
No description provided.