diff options
author | petermaxlee <petermaxlee@gmail.com> | 2016-08-11 23:56:55 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-08-11 23:56:55 -0700 |
commit | 00e103a6edd1a1f001a94d41dd1f7acc40a1e30f (patch) | |
tree | f20e1036827e7fceb8b512278ad7b1af1f807eb1 /sql/core/src/test/resources/sql-tests/results/arithmetic.sql.out | |
parent | abff92bfdc7d4c9d2308794f0350561fe0ceb4dd (diff) | |
download | spark-00e103a6edd1a1f001a94d41dd1f7acc40a1e30f.tar.gz spark-00e103a6edd1a1f001a94d41dd1f7acc40a1e30f.tar.bz2 spark-00e103a6edd1a1f001a94d41dd1f7acc40a1e30f.zip |
[SPARK-17013][SQL] Parse negative numeric literals
## What changes were proposed in this pull request?
This patch updates the SQL parser to parse negative numeric literals as numeric literals, instead of unary minus of positive literals.
This allows the parser to parse the minimal value for each data type, e.g. "-32768S".
## How was this patch tested?
Updated test cases.
Author: petermaxlee <petermaxlee@gmail.com>
Closes #14608 from petermaxlee/SPARK-17013.
Diffstat (limited to 'sql/core/src/test/resources/sql-tests/results/arithmetic.sql.out')
-rw-r--r-- | sql/core/src/test/resources/sql-tests/results/arithmetic.sql.out | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sql/core/src/test/resources/sql-tests/results/arithmetic.sql.out b/sql/core/src/test/resources/sql-tests/results/arithmetic.sql.out index 50ea254b0b..f2b40a00d0 100644 --- a/sql/core/src/test/resources/sql-tests/results/arithmetic.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/arithmetic.sql.out @@ -5,7 +5,7 @@ -- !query 0 select -100 -- !query 0 schema -struct<(-100):int> +struct<-100:int> -- !query 0 output -100 @@ -21,7 +21,7 @@ struct<230:int> -- !query 2 select -5.2 -- !query 2 schema -struct<(-5.2):decimal(2,1)> +struct<-5.2:decimal(2,1)> -- !query 2 output -5.2 @@ -37,7 +37,7 @@ struct<6.8:double> -- !query 4 select -key, +key from testdata where key = 2 -- !query 4 schema -struct<(-key):int,key:int> +struct<(- key):int,key:int> -- !query 4 output -2 2 @@ -45,7 +45,7 @@ struct<(-key):int,key:int> -- !query 5 select -(key + 1), - key + 1, +(key + 5) from testdata where key = 1 -- !query 5 schema -struct<(-(key + 1)):int,((-key) + 1):int,(key + 5):int> +struct<(- (key + 1)):int,((- key) + 1):int,(key + 5):int> -- !query 5 output -2 0 6 @@ -53,7 +53,7 @@ struct<(-(key + 1)):int,((-key) + 1):int,(key + 5):int> -- !query 6 select -max(key), +max(key) from testdata -- !query 6 schema -struct<(-max(key)):int,max(key):int> +struct<(- max(key)):int,max(key):int> -- !query 6 output -100 100 @@ -61,7 +61,7 @@ struct<(-max(key)):int,max(key):int> -- !query 7 select - (-10) -- !query 7 schema -struct<(-(-10)):int> +struct<(- -10):int> -- !query 7 output 10 @@ -69,7 +69,7 @@ struct<(-(-10)):int> -- !query 8 select + (-key) from testdata where key = 32 -- !query 8 schema -struct<(-key):int> +struct<(- key):int> -- !query 8 output -32 @@ -77,7 +77,7 @@ struct<(-key):int> -- !query 9 select - (+max(key)) from testdata -- !query 9 schema -struct<(-max(key)):int> +struct<(- max(key)):int> -- !query 9 output -100 @@ -85,7 +85,7 @@ struct<(-max(key)):int> -- !query 10 select - - 3 -- !query 10 schema -struct<(-(-3)):int> +struct<(- -3):int> -- !query 10 output 3 @@ -93,7 +93,7 @@ struct<(-(-3)):int> -- !query 11 select - + 20 -- !query 11 schema -struct<(-20):int> +struct<(- 20):int> -- !query 11 output -20 @@ -109,7 +109,7 @@ struct<100:int> -- !query 13 select - - max(key) from testdata -- !query 13 schema -struct<(-(-max(key))):int> +struct<(- (- max(key))):int> -- !query 13 output 100 @@ -117,7 +117,7 @@ struct<(-(-max(key))):int> -- !query 14 select + - key from testdata where key = 33 -- !query 14 schema -struct<(-key):int> +struct<(- key):int> -- !query 14 output -33 @@ -173,6 +173,6 @@ struct<(5 % 3):int> -- !query 21 select pmod(-7, 3) -- !query 21 schema -struct<pmod((-7), 3):int> +struct<pmod(-7, 3):int> -- !query 21 output 2 |