diff options
author | William Benton <willb@redhat.com> | 2014-09-08 19:05:02 -0700 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2014-09-08 19:05:02 -0700 |
commit | ca0348e68213c2c7589f2018ebf9d889c0ce59c3 (patch) | |
tree | ba79a7421b6bcf01299af1ec6e7a2ba816387b41 /sql/core | |
parent | 50a4fa774a0e8a17d7743b33ce8941bf4041144d (diff) | |
download | spark-ca0348e68213c2c7589f2018ebf9d889c0ce59c3.tar.gz spark-ca0348e68213c2c7589f2018ebf9d889c0ce59c3.tar.bz2 spark-ca0348e68213c2c7589f2018ebf9d889c0ce59c3.zip |
SPARK-3423: [SQL] Implement BETWEEN for SQLParser
This patch improves the SQLParser by adding support for BETWEEN conditions
Author: William Benton <willb@redhat.com>
Closes #2295 from willb/sql-between and squashes the following commits:
0016d30 [William Benton] Implement BETWEEN for SQLParser
Diffstat (limited to 'sql/core')
-rw-r--r-- | sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala index e8fbc28d0a..45c0ca8ea1 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala @@ -597,4 +597,22 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll { (3, null) :: (4, 2147483644) :: Nil) } + + test("SPARK-3423 BETWEEN") { + checkAnswer( + sql("SELECT key, value FROM testData WHERE key BETWEEN 5 and 7"), + Seq((5, "5"), (6, "6"), (7, "7")) + ) + + checkAnswer( + sql("SELECT key, value FROM testData WHERE key BETWEEN 7 and 7"), + Seq((7, "7")) + ) + + checkAnswer( + sql("SELECT key, value FROM testData WHERE key BETWEEN 9 and 7"), + Seq() + ) + + } } |