aboutsummaryrefslogtreecommitdiff
path: root/sql/hive
diff options
context:
space:
mode:
authorHerman van Hovell <hvanhovell@databricks.com>2016-10-04 23:48:26 -0700
committerReynold Xin <rxin@databricks.com>2016-10-04 23:48:26 -0700
commit89516c1c4a167249b0c82f60a62edb45ede3bd2c (patch)
tree38fd2f4683fe15f4d311204c8a5060cf847ebe13 /sql/hive
parentc9fe10d4ed8df5ac4bd0f1eb8c9cd19244e27736 (diff)
downloadspark-89516c1c4a167249b0c82f60a62edb45ede3bd2c.tar.gz
spark-89516c1c4a167249b0c82f60a62edb45ede3bd2c.tar.bz2
spark-89516c1c4a167249b0c82f60a62edb45ede3bd2c.zip
[SPARK-17258][SQL] Parse scientific decimal literals as decimals
## What changes were proposed in this pull request? Currently Spark SQL parses regular decimal literals (e.g. `10.00`) as decimals and scientific decimal literals (e.g. `10.0e10`) as doubles. The difference between the two confuses most users. This PR unifies the parsing behavior and also parses scientific decimal literals as decimals. This implications in tests are limited to a single Hive compatibility test. ## How was this patch tested? Updated tests in `ExpressionParserSuite` and `SQLQueryTestSuite`. Author: Herman van Hovell <hvanhovell@databricks.com> Closes #14828 from hvanhovell/SPARK-17258.
Diffstat (limited to 'sql/hive')
-rw-r--r--sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala b/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala
index bebcb8f801..f5d10de8cd 100644
--- a/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala
+++ b/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala
@@ -555,6 +555,9 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter {
"varchar_2",
"varchar_join1",
+ // This test assumes we parse scientific decimals as doubles (we parse them as decimals)
+ "literal_double",
+
// These tests are duplicates of joinXYZ
"auto_join0",
"auto_join1",
@@ -832,7 +835,6 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter {
"leftsemijoin_mr",
"limit_pushdown_negative",
"lineage1",
- "literal_double",
"literal_ints",
"literal_string",
"load_dyn_part1",