yaooqinn commented on a change in pull request #30332:
URL: https://github.com/apache/spark/pull/30332#discussion_r521778847
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
##########
@@ -79,20 +80,30 @@ class SparkSqlAstBuilder(conf: SQLConf) extends
AstBuilder(conf) {
case s if s.isEmpty =>
SetCommand(None)
case _ => throw new ParseException("Expected format is 'SET', 'SET key',
or " +
- "'SET key=value'. If you want to include special characters in key, " +
- "please use quotes, e.g., SET `ke y`=value.", ctx)
+ "'SET key=value'. If you want to include special characters in key or
semicolon is value," +
+ " please use quotes, e.g., SET `ke y`=`value`.", ctx)
}
}
- override def visitSetQuotedConfiguration(ctx: SetQuotedConfigurationContext)
- : LogicalPlan = withOrigin(ctx) {
- val keyStr = ctx.configKey().getText
- if (ctx.EQ() != null) {
- SetCommand(Some(keyStr -> Option(remainder(ctx.EQ().getSymbol).trim)))
- } else {
- SetCommand(Some(keyStr -> None))
+ override def visitSetQuotedConfiguration(
+ ctx: SetQuotedConfigurationContext): LogicalPlan = withOrigin(ctx) {
+ if (ctx.configValue() != null && ctx.configKey() != null) {
+ SetCommand(Some(ctx.configKey().getText ->
Option(ctx.configValue().getText)))
+ } else if (ctx.configValue() != null) {
+ SetCommand(Some(ctx.anything.getText ->
Option(ctx.configValue().getText)))
Review comment:
oh right~
----------------------------------------------------------------
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]