Github user ericsahit commented on a diff in the pull request:
https://github.com/apache/spark/pull/18268#discussion_r124445231
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/SetCommand.scala
---
@@ -150,12 +150,21 @@ object SetCommand {
* This command is for resetting SQLConf to the default values. Command
that runs
* {{{
* reset;
+ * reset key;
+ * reset key1 key2 ...;
* }}}
*/
-case object ResetCommand extends RunnableCommand with Logging {
+case class ResetCommand(key: Option[String]) extends RunnableCommand with
Logging {
override def run(sparkSession: SparkSession): Seq[Row] = {
- sparkSession.sessionState.conf.clear()
+ key match {
+ case None =>
+ sparkSession.sessionState.conf.clear()
+ // "RESET key" clear a specific property.
+ case Some(key) =>
+ key.split("\\s+")
--- End diff --
OK, i plan adding `Quoted Identifiers` support for such special situation,
after all Quote symbol will be the only `special delimiter`. final use case
like this:
```
spark-sql> set a b=1;
key value
a b 1
Time taken: 0.018 seconds, Fetched 1 row(s)
spark-sql> set c d=2;
key value
c d 2
Time taken: 0.018 seconds, Fetched 1 row(s)
spark-sql> reset a b c d;
Time taken: 0.01 seconds
spark-sql> set a b;
key value
a b 1
spark-sql> reset `a b` `c d`;
Time taken: 0.01 seconds
spark-sql> set a b;
key value
a b <undefined>
Time taken: 0.016 seconds, Fetched 1 row(s)
spark-sql> set c d;
key value
c d <undefined>
spark-sql> reset `a b;
Error in query: Invalid usage of '`' in expression;
```
I though we should open another issue,
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]