-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-20585][SPARKR] R generic hint support #17851
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
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e21d51e
Initial implementation
zero323 261e5a6
Add since note
zero323 ee52b53
Fix style
zero323 a1e9233
Put hint generic in the right place
zero323 633b038
Remove empty line
zero323 3ed4d76
Adjust hint description
zero323 1183441
Adjust ... description
zero323 e6c6d82
Adujst description
zero323 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2147,6 +2147,18 @@ test_that("join(), crossJoin() and merge() on a DataFrame", { | |
|
|
||
| unlink(jsonPath2) | ||
| unlink(jsonPath3) | ||
|
|
||
| # Join with broadcast hint | ||
| df1 <- sql("SELECT * FROM range(10e10)") | ||
| df2 <- sql("SELECT * FROM range(10e10)") | ||
|
|
||
| execution_plan <- capture.output(explain(join(df1, df2, df1$id == df2$id))) | ||
| expect_false(any(grepl("BroadcastHashJoin", execution_plan))) | ||
|
|
||
| execution_plan_hint <- capture.output( | ||
| explain(join(df1, hint(df2, "broadcast"), df1$id == df2$id)) | ||
| ) | ||
| expect_true(any(grepl("BroadcastHashJoin", execution_plan_hint))) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. awesome! |
||
| }) | ||
|
|
||
| test_that("toJSON() on DataFrame", { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
you recreated
createDataFrame(mtcars)here, do you mean to usedffrom the line before?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.
or you want to show these are two different dataset? maybe it's worthwhile to comment that
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 wanted to use different datasets to avoid aliasing and trivially equal warning. It works but it is confusing (note: equi-join syntax same as in Scala or Python would be great, and it shouldn't be that hard to add). Once we merge
aliasthis shouldn't been an issue. Since we don't run it, I can add aliases now.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.
aliasis going to 2.3, this is going to 2.2 - I think we leave this for now and can improve this in master laterThere 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.
Also with alias it will be quite dense:
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.
right - I think the example makes sense now but it might not be very obvious - for example,
vs
is not very subtle unless you know what Spark is doing differently here. This is why I suggested pointing out the need to have distinct "copies" of data