maropu commented on a change in pull request #29146:
URL: https://github.com/apache/spark/pull/29146#discussion_r464238349
##########
File path:
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
##########
@@ -246,11 +246,17 @@ statement
| SET TIME ZONE interval
#setTimeZone
| SET TIME ZONE timezone=(STRING | LOCAL)
#setTimeZone
| SET TIME ZONE .*?
#setTimeZone
+ | SET quotedConfigKey (EQ value=.*)?
#setQuotedConfiguration
| SET .*?
#setConfiguration
+ | RESET quotedConfigKey
#resetQuotedConfiguration
| RESET .*?
#resetConfiguration
| unsupportedHiveNativeCommands .*?
#failNativeCommand
;
+quotedConfigKey
Review comment:
Yea, I did so first, but that suggested definition did not invoke
`PostProcessor.exitQuotedIdentifier` to split backquotes;
```
- | SET quotedConfigKey (EQ value=.*)?
#setQuotedConfiguration
+ | SET key=quotedIdentifier (EQ value=.*)?
#setQuotedConfiguration
override def visitSetQuotedConfiguration(ctx:
SetQuotedConfigurationContext)
: LogicalPlan = withOrigin(ctx) {
- val keyStr = ctx.quotedConfigKey().getText
+ val keyStr = ctx.key.getText
assertEqual("SET `spark.sql. key`=value",
SetCommand(Some("spark.sql. key" -> Some("value"))))
fo] - Report Error for invalid usage of SET command *** FAILED *** (106
milliseconds)
[info] == FAIL: Plans do not match ===
[info] !SetCommand (`spark.sql. key`,Some(value)) SetCommand
(spark.sql. key,Some(value)) (PlanTest.scala:157)
[info] org.scalatest.exceptions.TestFailedException:
...
```
So, we need replace("`", "") for that approach. Please check the lates
commit.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]