-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-3650][GraphX] Triangle Count handles reverse edges incorrectly #11290
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
| // This algorithm double counts each triangle so the final count should be even | ||
| val isEven = (dblCount & 1) == 0 | ||
| if (!isEven) { | ||
| throw new Exception("Triangle count resulted in an invalid number of triangles.") |
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.
I would just require(...) this condition. (dblCount % 2) == 0 would be a little more canonical
|
@srowen good points, I've updated and pushed changes in line with your comments |
|
Jenkins, test this please |
|
Test build #51640 has finished for PR 11290 at commit
|
|
This looks good to me. @insidedctm thanks for reviving the PR and @srowen thanks for taking a look at this! My only minor concern is that it will change the results for people that are using triangle count so we should note this in the change log on the next release. |
|
This is great timing given the next version is 2.0. |
|
I'm going to merge this in master. Thanks. |
@jegonzal @ankurdave please could you review
What changes were proposed in this pull request?
Reworking of @jegonzal PR #2495 to address the issue identified in SPARK-3650. Code amended to use the convertToCanonicalEdges method.
How was the this patch tested?
Patch was tested using the unit tests created in PR #2495