aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/test/resources/sql-tests/results
diff options
context:
space:
mode:
authorHerman van Hovell <hvanhovell@databricks.com>2016-08-26 13:29:22 -0700
committerReynold Xin <rxin@databricks.com>2016-08-26 13:29:22 -0700
commita11d10f1826b578ff721c4738224eef2b3c3b9f3 (patch)
treef8d4bf7abf2dda4b78655db707eb4d4b8624196a /sql/core/src/test/resources/sql-tests/results
parent8e5475be3c9a620f18f6712631b093464a7d0ee7 (diff)
downloadspark-a11d10f1826b578ff721c4738224eef2b3c3b9f3.tar.gz
spark-a11d10f1826b578ff721c4738224eef2b3c3b9f3.tar.bz2
spark-a11d10f1826b578ff721c4738224eef2b3c3b9f3.zip
[SPARK-17246][SQL] Add BigDecimal literal
## What changes were proposed in this pull request? This PR adds parser support for `BigDecimal` literals. If you append the suffix `BD` to a valid number then this will be interpreted as a `BigDecimal`, for example `12.0E10BD` will interpreted into a BigDecimal with scale -9 and precision 3. This is useful in situations where you need exact values. ## How was this patch tested? Added tests to `ExpressionParserSuite`, `ExpressionSQLBuilderSuite` and `SQLQueryTestSuite`. Author: Herman van Hovell <hvanhovell@databricks.com> Closes #14819 from hvanhovell/SPARK-17246.
Diffstat (limited to 'sql/core/src/test/resources/sql-tests/results')
-rw-r--r--sql/core/src/test/resources/sql-tests/results/literals.sql.out24
1 files changed, 23 insertions, 1 deletions
diff --git a/sql/core/src/test/resources/sql-tests/results/literals.sql.out b/sql/core/src/test/resources/sql-tests/results/literals.sql.out
index 67e6d78dfb..85629f7ba8 100644
--- a/sql/core/src/test/resources/sql-tests/results/literals.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/literals.sql.out
@@ -1,5 +1,5 @@
-- Automatically generated by SQLQueryTestSuite
--- Number of queries: 38
+-- Number of queries: 40
-- !query 0
@@ -354,3 +354,25 @@ Literals of type 'GEO' are currently not supported.(line 1, pos 7)
== SQL ==
select GEO '(10,-6)'
-------^^^
+
+
+-- !query 38
+select 90912830918230182310293801923652346786BD, 123.0E-28BD, 123.08BD
+-- !query 38 schema
+struct<90912830918230182310293801923652346786:decimal(38,0),1.230E-26:decimal(29,29),123.08:decimal(5,2)>
+-- !query 38 output
+90912830918230182310293801923652346786 0.0000000000000000000000000123 123.08
+
+
+-- !query 39
+select 1.20E-38BD
+-- !query 39 schema
+struct<>
+-- !query 39 output
+org.apache.spark.sql.catalyst.parser.ParseException
+
+DecimalType can only support precision up to 38(line 1, pos 7)
+
+== SQL ==
+select 1.20E-38BD
+-------^^^