diff options
author | petermaxlee <petermaxlee@gmail.com> | 2016-08-10 21:05:32 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-08-10 21:05:32 -0700 |
commit | 425c7c2dbd2923094712e1215dd29272fb09cd79 (patch) | |
tree | dbf81f9f2411b14d913f63d855d47a92c154d250 /sql/core/src/test/resources/sql-tests/results/having.sql.out | |
parent | ab648c0004cfb20d53554ab333dd2d198cb94ffa (diff) | |
download | spark-425c7c2dbd2923094712e1215dd29272fb09cd79.tar.gz spark-425c7c2dbd2923094712e1215dd29272fb09cd79.tar.bz2 spark-425c7c2dbd2923094712e1215dd29272fb09cd79.zip |
[SPARK-17008][SPARK-17009][SQL] Normalization and isolation in SQLQueryTestSuite.
## What changes were proposed in this pull request?
This patch enhances SQLQueryTestSuite in two ways:
1. SPARK-17009: Use a new SparkSession for each test case to provide stronger isolation (e.g. config changes in one test case does not impact another). That said, we do not currently isolate catalog changes.
2. SPARK-17008: Normalize query output using sorting, inspired by HiveComparisonTest.
I also ported a few new test cases over from SQLQuerySuite.
## How was this patch tested?
This is a test harness update.
Author: petermaxlee <petermaxlee@gmail.com>
Closes #14590 from petermaxlee/SPARK-17008.
Diffstat (limited to 'sql/core/src/test/resources/sql-tests/results/having.sql.out')
-rw-r--r-- | sql/core/src/test/resources/sql-tests/results/having.sql.out | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/sql/core/src/test/resources/sql-tests/results/having.sql.out b/sql/core/src/test/resources/sql-tests/results/having.sql.out new file mode 100644 index 0000000000..0bc8be66be --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/having.sql.out @@ -0,0 +1,40 @@ +-- Automatically generated by org.apache.spark.sql.SQLQueryTestSuite +-- Number of queries: 4 + + +-- !query 0 +create temporary view hav as select * from values + ("one", 1), + ("two", 2), + ("three", 3), + ("one", 5) + as hav(k, v) +-- !query 0 schema +struct<> +-- !query 0 output + + + +-- !query 1 +SELECT k, sum(v) FROM hav GROUP BY k HAVING sum(v) > 2 +-- !query 1 schema +struct<k:string,sum(v):bigint> +-- !query 1 output +one 6 +three 3 + + +-- !query 2 +SELECT count(k) FROM hav GROUP BY v + 1 HAVING v + 1 = 2 +-- !query 2 schema +struct<count(k):bigint> +-- !query 2 output +1 + + +-- !query 3 +SELECT MIN(t.v) FROM (SELECT * FROM hav WHERE v > 0) t HAVING(COUNT(1) > 0) +-- !query 3 schema +struct<min(v):int> +-- !query 3 output +1 |