Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,17 @@ statement
| SET TIME ZONE interval #setTimeZone
| SET TIME ZONE timezone=(STRING | LOCAL) #setTimeZone
| SET TIME ZONE .*? #setTimeZone
| SET key=quotedIdentifier (EQ value=.*)? #setQuotedConfiguration
| SET configKey (EQ .*?)? #setQuotedConfiguration
| SET .*? #setConfiguration
| RESET key=quotedIdentifier #resetQuotedConfiguration
| RESET configKey #resetQuotedConfiguration
| RESET .*? #resetConfiguration
| unsupportedHiveNativeCommands .*? #failNativeCommand
;

configKey
: quotedIdentifier
;

unsupportedHiveNativeCommands
: kw1=CREATE kw2=ROLE
| kw1=DROP kw2=ROLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ class SparkSqlAstBuilder(conf: SQLConf) extends AstBuilder(conf) {

override def visitSetQuotedConfiguration(ctx: SetQuotedConfigurationContext)
: LogicalPlan = withOrigin(ctx) {
val keyStr = ctx.key.getText.replaceAll("`", "")
if (ctx.value != null) {
val keyStr = ctx.configKey().getText
if (ctx.EQ() != null) {
SetCommand(Some(keyStr -> Option(remainder(ctx.EQ().getSymbol).trim)))
} else {
SetCommand(Some(keyStr -> None))
Expand Down Expand Up @@ -117,7 +117,7 @@ class SparkSqlAstBuilder(conf: SQLConf) extends AstBuilder(conf) {

override def visitResetQuotedConfiguration(
ctx: ResetQuotedConfigurationContext): LogicalPlan = withOrigin(ctx) {
ResetCommand(Some(ctx.key.getText.replaceAll("`", "")))
ResetCommand(Some(ctx.configKey().getText))
}

/**
Expand Down