aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/test/resources/sql-tests/results
diff options
context:
space:
mode:
authorpetermaxlee <petermaxlee@gmail.com>2016-08-10 17:17:21 +0800
committerWenchen Fan <wenchen@databricks.com>2016-08-10 17:17:21 +0800
commitb9f8a117097bc102e261b68f38a679d16e19f2e2 (patch)
tree885731daded3aa3d50fdcff0cdc5d898aa735a03 /sql/core/src/test/resources/sql-tests/results
parent0578ff9681edbaab4ae68f67272dc3d4d890d53b (diff)
downloadspark-b9f8a117097bc102e261b68f38a679d16e19f2e2.tar.gz
spark-b9f8a117097bc102e261b68f38a679d16e19f2e2.tar.bz2
spark-b9f8a117097bc102e261b68f38a679d16e19f2e2.zip
[SPARK-16866][SQL] Infrastructure for file-based SQL end-to-end tests
## What changes were proposed in this pull request? This patch introduces SQLQueryTestSuite, a basic framework for end-to-end SQL test cases defined in spark/sql/core/src/test/resources/sql-tests. This is a more standard way to test SQL queries end-to-end in different open source database systems, because it is more manageable to work with files. This is inspired by HiveCompatibilitySuite, but simplified for general Spark SQL tests. Once this is merged, I can work towards porting SQLQuerySuite over, and eventually also move the existing HiveCompatibilitySuite to use this framework. Unlike HiveCompatibilitySuite, SQLQueryTestSuite compares both the output schema and the output data (in string form). When there is a mismatch, the error message looks like the following: ``` [info] - blacklist.sql !!! IGNORED !!! [info] - number-format.sql *** FAILED *** (2 seconds, 405 milliseconds) [info] Expected "...147483648 -214748364[8]", but got "...147483648 -214748364[9]" Result should match for query #1 (SQLQueryTestSuite.scala:171) [info] org.scalatest.exceptions.TestFailedException: [info] at org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:495) [info] at org.scalatest.FunSuite.newAssertionFailedException(FunSuite.scala:1555) [info] at org.scalatest.Assertions$class.assertResult(Assertions.scala:1171) ``` ## How was this patch tested? This is a test infrastructure change. Author: petermaxlee <petermaxlee@gmail.com> Closes #14472 from petermaxlee/SPARK-16866.
Diffstat (limited to 'sql/core/src/test/resources/sql-tests/results')
-rw-r--r--sql/core/src/test/resources/sql-tests/results/number-format.sql.out34
1 files changed, 34 insertions, 0 deletions
diff --git a/sql/core/src/test/resources/sql-tests/results/number-format.sql.out b/sql/core/src/test/resources/sql-tests/results/number-format.sql.out
new file mode 100644
index 0000000000..4b800b7d92
--- /dev/null
+++ b/sql/core/src/test/resources/sql-tests/results/number-format.sql.out
@@ -0,0 +1,34 @@
+-- Automatically generated by org.apache.spark.sql.SQLQueryTestSuite
+-- Number of queries: 4
+
+
+-- !query 0
+select 1, -1
+-- !query 0 schema
+struct<1:int,(-1):int>
+-- !query 0 output
+1 -1
+
+
+-- !query 1
+select 2147483648, -2147483649
+-- !query 1 schema
+struct<2147483648:bigint,(-2147483649):bigint>
+-- !query 1 output
+2147483648 -2147483649
+
+
+-- !query 2
+select 9223372036854775808, -9223372036854775809
+-- !query 2 schema
+struct<9223372036854775808:decimal(19,0),(-9223372036854775809):decimal(19,0)>
+-- !query 2 output
+9223372036854775808 -9223372036854775809
+
+
+-- !query 3
+select 0.3, -0.8, .5, -.18, 0.1111
+-- !query 3 schema
+struct<0.3:decimal(1,1),(-0.8):decimal(1,1),0.5:decimal(1,1),(-0.18):decimal(2,2),0.1111:decimal(4,4)>
+-- !query 3 output
+0.3 -0.8 0.5 -0.18 0.1111