-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Spark 3.5: Add tests for WHEN NOT MATCHED BY SOURCE clauses #8592
Spark 3.5: Add tests for WHEN NOT MATCHED BY SOURCE clauses #8592
Conversation
assertEquals( | ||
"Should have expected rows", | ||
ImmutableList.of( | ||
row(1, "emp-id-1"), // updated (matched) |
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.
Currently this is a little confusing because the results are not in the same order as the clauses above
Clause 1
Clause 4
Clause 3
Could we add in some blanks and make it look more like
Clause 1 result row,
// Clause 2 row deleted
Clause 3 result row,
Clause 4 result row,
// Clause 5 row deleted
Minor nit here and would require rewriting this a little, it would just make the test a bit easier to read
+ "{ \"id\": 3, \"dep\": \"emp-id-3\" }\n" | ||
+ "{ \"id\": 4, \"dep\": \"emp-id-4\" }"); | ||
|
||
createOrReplaceView("source", Collections.singletonList(1), Encoders.INT()); |
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.
It is not super clear here that this makes a table with an ID column with a single element, there are also different methods used for providing lists below.
Nit: I think we could be consistent with just always using ImmutableList.of(...)
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 to me, just have some test style nits which you are free to ignore
Thanks, @RussellSpitzer @rdblue @Fokko! |
This PR adds tests for WHEN NOT MATCHED BY SOURCE clauses, supported in Spark 3.5.
This resolves #8276. There are more tests in Spark itself, it is just a sanity check mostly.