-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21654][SQL] Complement SQL predicates expression description #18869
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
Changes from 2 commits
9895843
1369fd5
bca2b0b
b64c9e6
d8f1479
099c671
444c64d
ec9199a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,42 @@ | ||||||||||||||||||||||||
| -- In | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| assertError(EqualTo('mapField, 'mapField), "EqualTo does not support ordering on type MapType") | |
| assertError(EqualNullSafe('mapField, 'mapField), | |
| "EqualNullSafe does not support ordering on type MapType") | |
| assertError(LessThan('mapField, 'mapField), | |
| "LessThan does not support ordering on type MapType") | |
| assertError(LessThanOrEqual('mapField, 'mapField), | |
| "LessThanOrEqual does not support ordering on type MapType") | |
| assertError(GreaterThan('mapField, 'mapField), | |
| "GreaterThan does not support ordering on type MapType") | |
| assertError(GreaterThanOrEqual('mapField, 'mapField), | |
| "GreaterThanOrEqual does not support ordering on type MapType") |
More tests are always good and not harm, I agreed. If the necessary tests are not added before, we should add and improve them.
Outdated
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.
For In, I've locally complemented its test coverage in PredicateSuite and use checkEvaluation. I'd prefer to have it in a following PR if you don't insist to add it in this PR.
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 like the existing test for In is not well covered. We should improve it. I will commit the tests I added locally.
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.
The following test cases are intended to test the end-to-end comparison between different types. It doesn't make much sense to re-write them with checkEvaluation. We'd have something like checkEvaluation(GreaterThan(Cast(...), ...), true) with manually added Cast. We have unit tests against Cast and GreaterThan individually.
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.
For the test cases that trigger implicit type casting, we can keep them here.
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.
@viirya, BTW, I think we could also do this as below:
Just double checked it renders fine in the doc as well.
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.
Thanks. Fixed.