-
- Downloads
[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.
Showing
- sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4 1 addition, 6 deletions...in/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala 0 additions, 8 deletions...ala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala 12 additions, 12 deletions...che/spark/sql/catalyst/parser/ExpressionParserSuite.scala
- sql/core/src/test/resources/sql-tests/inputs/literals.sql 5 additions, 3 deletionssql/core/src/test/resources/sql-tests/inputs/literals.sql
- sql/core/src/test/resources/sql-tests/results/arithmetic.sql.out 1 addition, 1 deletion...e/src/test/resources/sql-tests/results/arithmetic.sql.out
- sql/core/src/test/resources/sql-tests/results/literals.sql.out 16 additions, 8 deletions...ore/src/test/resources/sql-tests/results/literals.sql.out
- sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala 3 additions, 1 deletion...che/spark/sql/hive/execution/HiveCompatibilitySuite.scala
Please register or sign in to comment