-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-21654][SQL] Complement SQL predicates expression description #18869
Changes from 7 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,36 @@ | ||
-- EqualTo | ||
select 1 = 1; | ||
select 1 = '1'; | ||
select 1.0 = '1'; | ||
|
||
-- GreaterThan | ||
select 1 > '1'; | ||
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. 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 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. For the test cases that trigger implicit type casting, we can keep them here. |
||
select 2 > '1.0'; | ||
select 2 > '2.0'; | ||
select 2 > '2.2'; | ||
select to_date('2009-07-30 04:17:52') > to_date('2009-07-30 04:17:52'); | ||
select to_date('2009-07-30 04:17:52') > '2009-07-30 04:17:52'; | ||
|
||
-- GreaterThanOrEqual | ||
select 1 >= '1'; | ||
select 2 >= '1.0'; | ||
select 2 >= '2.0'; | ||
select 2.0 >= '2.2'; | ||
select to_date('2009-07-30 04:17:52') >= to_date('2009-07-30 04:17:52'); | ||
select to_date('2009-07-30 04:17:52') >= '2009-07-30 04:17:52'; | ||
|
||
-- LessThan | ||
select 1 < '1'; | ||
select 2 < '1.0'; | ||
select 2 < '2.0'; | ||
select 2.0 < '2.2'; | ||
select to_date('2009-07-30 04:17:52') < to_date('2009-07-30 04:17:52'); | ||
select to_date('2009-07-30 04:17:52') < '2009-07-30 04:17:52'; | ||
|
||
-- LessThanOrEqual | ||
select 1 <= '1'; | ||
select 2 <= '1.0'; | ||
select 2 <= '2.0'; | ||
select 2.0 <= '2.2'; | ||
select to_date('2009-07-30 04:17:52') <= to_date('2009-07-30 04:17:52'); | ||
select to_date('2009-07-30 04:17:52') <= '2009-07-30 04:17:52'; |
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.
If the data type is not supported, it will silently skip the test. We can do something like
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.
Although I already filter out the unsupported data types when constructing
atomicTypes
, this is no harm. So ok for me. I will update it.