aboutsummaryrefslogtreecommitdiff
path: root/sql/catalyst
diff options
context:
space:
mode:
authorhyukjinkwon <gurwls223@gmail.com>2016-07-06 23:57:18 -0400
committerHerman van Hovell <hvanhovell@databricks.com>2016-07-06 23:57:18 -0400
commit34283de160808324da02964cd5dc5df80e59ae71 (patch)
treef4122927efb6b80b4c77772dbeaa0fea93f5ff73 /sql/catalyst
parent44c7c62bcfca74c82ffc4e3c53997fff47bfacac (diff)
downloadspark-34283de160808324da02964cd5dc5df80e59ae71.tar.gz
spark-34283de160808324da02964cd5dc5df80e59ae71.tar.bz2
spark-34283de160808324da02964cd5dc5df80e59ae71.zip
[SPARK-14839][SQL] Support for other types for `tableProperty` rule in SQL syntax
## What changes were proposed in this pull request? Currently, Scala API supports to take options with the types, `String`, `Long`, `Double` and `Boolean` and Python API also supports other types. This PR corrects `tableProperty` rule to support other types (string, boolean, double and integer) so that support the options for data sources in a consistent way. This will affect other rules such as DBPROPERTIES and TBLPROPERTIES (allowing other types as values). Also, `TODO add bucketing and partitioning.` was removed because it was resolved in https://github.com/apache/spark/commit/24bea000476cdd0b43be5160a76bc5b170ef0b42 ## How was this patch tested? Unit test in `MetastoreDataSourcesSuite.scala`. Author: hyukjinkwon <gurwls223@gmail.com> Closes #13517 from HyukjinKwon/SPARK-14839.
Diffstat (limited to 'sql/catalyst')
-rw-r--r--sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g49
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4 b/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
index 4c15f9cec6..7ccbb2dac9 100644
--- a/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
+++ b/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
@@ -249,7 +249,7 @@ tablePropertyList
;
tableProperty
- : key=tablePropertyKey (EQ? value=STRING)?
+ : key=tablePropertyKey (EQ? value=tablePropertyValue)?
;
tablePropertyKey
@@ -257,6 +257,13 @@ tablePropertyKey
| STRING
;
+tablePropertyValue
+ : INTEGER_VALUE
+ | DECIMAL_VALUE
+ | booleanValue
+ | STRING
+ ;
+
constantList
: '(' constant (',' constant)* ')'
;