diff options
author | gatorsmile <gatorsmile@gmail.com> | 2016-05-21 20:07:34 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-05-21 20:07:34 -0700 |
commit | 8f0a3d5bcba313dc3b70d4aa9a8ba2aa2d276062 (patch) | |
tree | f35feb55bf0c1fe384f0cdf0882fc9648f7eb513 /sql/catalyst | |
parent | c18fa464f404ed2612f8c4d355cb0544b355975b (diff) | |
download | spark-8f0a3d5bcba313dc3b70d4aa9a8ba2aa2d276062.tar.gz spark-8f0a3d5bcba313dc3b70d4aa9a8ba2aa2d276062.tar.bz2 spark-8f0a3d5bcba313dc3b70d4aa9a8ba2aa2d276062.zip |
[SPARK-15330][SQL] Implement Reset Command
#### What changes were proposed in this pull request?
Like `Set` Command in Hive, `Reset` is also supported by Hive. See the link: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli
Below is the related Hive JIRA: https://issues.apache.org/jira/browse/HIVE-3202
This PR is to implement such a command for resetting the SQL-related configuration to the default values. One of the use case shown in HIVE-3202 is listed below:
> For the purpose of optimization we set various configs per query. It's worthy but all those configs should be reset every time for next query.
#### How was this patch tested?
Added a test case.
Author: gatorsmile <gatorsmile@gmail.com>
Author: xiaoli <lixiao1983@gmail.com>
Author: Xiao Li <xiaoli@Xiaos-MacBook-Pro.local>
Closes #13121 from gatorsmile/resetCommand.
Diffstat (limited to 'sql/catalyst')
-rw-r--r-- | sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4 | 4 |
1 files changed, 3 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 06ac37b7f8..848c59e3b8 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 @@ -120,6 +120,7 @@ statement | ADD identifier .*? #addResource | SET ROLE .*? #failNativeCommand | SET .*? #setConfiguration + | RESET #resetConfiguration | unsupportedHiveNativeCommands .*? #failNativeCommand ; @@ -633,7 +634,7 @@ nonReserved | GROUPING | CUBE | ROLLUP | EXPLAIN | FORMAT | LOGICAL | FORMATTED | CODEGEN | TABLESAMPLE | USE | TO | BUCKET | PERCENTLIT | OUT | OF - | SET + | SET | RESET | VIEW | REPLACE | IF | NO | DATA @@ -748,6 +749,7 @@ MAP: 'MAP'; STRUCT: 'STRUCT'; COMMENT: 'COMMENT'; SET: 'SET'; +RESET: 'RESET'; DATA: 'DATA'; START: 'START'; TRANSACTION: 'TRANSACTION'; |