diff options
author | petermaxlee <petermaxlee@gmail.com> | 2016-08-11 01:43:08 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-08-11 01:43:08 -0700 |
commit | a7b02db457d5fc663ce6a1ef01bf04689870e6b4 (patch) | |
tree | fd52ff812f94761adb03e9610fcc053e14a96120 /sql/core/src/test/resources/sql-tests/results/order-by-ordinal.sql.out | |
parent | 0db373aaf87991207a7a8a09853b6fa602f0f45b (diff) | |
download | spark-a7b02db457d5fc663ce6a1ef01bf04689870e6b4.tar.gz spark-a7b02db457d5fc663ce6a1ef01bf04689870e6b4.tar.bz2 spark-a7b02db457d5fc663ce6a1ef01bf04689870e6b4.zip |
[SPARK-17015][SQL] group-by/order-by ordinal and arithmetic tests
## What changes were proposed in this pull request?
This patch adds three test files:
1. arithmetic.sql.out
2. order-by-ordinal.sql
3. group-by-ordinal.sql
This includes https://github.com/apache/spark/pull/14594.
## How was this patch tested?
This is a test case change.
Author: petermaxlee <petermaxlee@gmail.com>
Closes #14595 from petermaxlee/SPARK-17015.
Diffstat (limited to 'sql/core/src/test/resources/sql-tests/results/order-by-ordinal.sql.out')
-rw-r--r-- | sql/core/src/test/resources/sql-tests/results/order-by-ordinal.sql.out | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/sql/core/src/test/resources/sql-tests/results/order-by-ordinal.sql.out b/sql/core/src/test/resources/sql-tests/results/order-by-ordinal.sql.out new file mode 100644 index 0000000000..03a4e72d0f --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/order-by-ordinal.sql.out @@ -0,0 +1,143 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 12 + + +-- !query 0 +create temporary view data as select * from values + (1, 1), + (1, 2), + (2, 1), + (2, 2), + (3, 1), + (3, 2) + as data(a, b) +-- !query 0 schema +struct<> +-- !query 0 output + + + +-- !query 1 +select * from data order by 1 desc +-- !query 1 schema +struct<a:int,b:int> +-- !query 1 output +3 1 +3 2 +2 1 +2 2 +1 1 +1 2 + + +-- !query 2 +select * from data order by 1 desc, b desc +-- !query 2 schema +struct<a:int,b:int> +-- !query 2 output +3 2 +3 1 +2 2 +2 1 +1 2 +1 1 + + +-- !query 3 +select * from data order by 1 desc, 2 desc +-- !query 3 schema +struct<a:int,b:int> +-- !query 3 output +3 2 +3 1 +2 2 +2 1 +1 2 +1 1 + + +-- !query 4 +select * from data order by 1 + 0 desc, b desc +-- !query 4 schema +struct<a:int,b:int> +-- !query 4 output +1 2 +2 2 +3 2 +1 1 +2 1 +3 1 + + +-- !query 5 +select * from data order by 0 +-- !query 5 schema +struct<> +-- !query 5 output +org.apache.spark.sql.AnalysisException +ORDER BY position 0 is not in select list (valid range is [1, 2]); line 1 pos 28 + + +-- !query 6 +select * from data order by -1 +-- !query 6 schema +struct<> +-- !query 6 output +org.apache.spark.sql.AnalysisException +ORDER BY position -1 is not in select list (valid range is [1, 2]); line 1 pos 28 + + +-- !query 7 +select * from data order by 3 +-- !query 7 schema +struct<> +-- !query 7 output +org.apache.spark.sql.AnalysisException +ORDER BY position 3 is not in select list (valid range is [1, 2]); line 1 pos 28 + + +-- !query 8 +select * from data sort by 1 desc +-- !query 8 schema +struct<a:int,b:int> +-- !query 8 output +1 1 +1 2 +2 1 +2 2 +3 1 +3 2 + + +-- !query 9 +set spark.sql.orderByOrdinal=false +-- !query 9 schema +struct<key:string,value:string> +-- !query 9 output +spark.sql.orderByOrdinal + + +-- !query 10 +select * from data order by 0 +-- !query 10 schema +struct<a:int,b:int> +-- !query 10 output +1 1 +1 2 +2 1 +2 2 +3 1 +3 2 + + +-- !query 11 +select * from data sort by 0 +-- !query 11 schema +struct<a:int,b:int> +-- !query 11 output +1 1 +1 2 +2 1 +2 2 +3 1 +3 2 |