-
Notifications
You must be signed in to change notification settings - Fork 28.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-21654][SQL] Complement SQL predicates expression description
## What changes were proposed in this pull request? SQL predicates don't have complete expression description. This patch goes to complement the description by adding arguments, examples. This change also adds related test cases for the SQL predicate expressions. ## How was this patch tested? Existing tests. And added predicate test. Author: Liang-Chi Hsieh <viirya@gmail.com> Closes #18869 from viirya/SPARK-21654.
- Loading branch information
1 parent
07fd68a
commit 9f30d92
Showing
4 changed files
with
460 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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 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
36 changes: 36 additions & 0 deletions
36
sql/core/src/test/resources/sql-tests/inputs/predicate-functions.sql
This file contains 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
-- EqualTo | ||
select 1 = 1; | ||
select 1 = '1'; | ||
select 1.0 = '1'; | ||
|
||
-- GreaterThan | ||
select 1 > '1'; | ||
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'; |
Oops, something went wrong.