-
- Downloads
[SPARK-20492][SQL] Do not print empty parentheses for invalid primitive types in parser
## What changes were proposed in this pull request? Currently, when the type string is invalid, it looks printing empty parentheses. This PR proposes a small improvement in an error message by removing it in the parse as below: ```scala spark.range(1).select($"col".cast("aa")) ``` **Before** ``` org.apache.spark.sql.catalyst.parser.ParseException: DataType aa() is not supported.(line 1, pos 0) == SQL == aa ^^^ ``` **After** ``` org.apache.spark.sql.catalyst.parser.ParseException: DataType aa is not supported.(line 1, pos 0) == SQL == aa ^^^ ``` ## How was this patch tested? Unit tests in `DataTypeParserSuite`. Author: hyukjinkwon <gurwls223@gmail.com> Closes #17784 from HyukjinKwon/SPARK-20492.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala 2 additions, 2 deletions...ala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DataTypeParserSuite.scala 6 additions, 1 deletion...pache/spark/sql/catalyst/parser/DataTypeParserSuite.scala
- sql/core/src/test/resources/sql-tests/results/json-functions.sql.out 1 addition, 1 deletion...c/test/resources/sql-tests/results/json-functions.sql.out
- sql/core/src/test/scala/org/apache/spark/sql/JsonFunctionsSuite.scala 1 addition, 1 deletion.../test/scala/org/apache/spark/sql/JsonFunctionsSuite.scala
Please register or sign in to comment