rdblue commented on a change in pull request #27402: [SPARK-30679][SQL] REPLACE
TABLE can omit the USING clause
URL: https://github.com/apache/spark/pull/27402#discussion_r373167187
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -2813,7 +2813,9 @@ class AstBuilder(conf: SQLConf) extends
SqlBaseBaseVisitor[AnyRef] with Logging
val (partitioning, bucketSpec, properties, options, location, comment) =
visitCreateTableClauses(ctx.createTableClauses())
val schema = Option(ctx.colTypeList()).map(createSchema)
- val provider = ctx.tableProvider.multipartIdentifier.getText
+ val defaultProvider = conf.defaultDataSourceName
+ val provider =
+
Option(ctx.tableProvider).map(_.multipartIdentifier.getText).getOrElse(defaultProvider)
Review comment:
The default provider should not be set here. The purpose of the statement
logical plans is to carry only what was expressed in SQL. Replacing with a
default loses the fact that this query had no provider specified.
Instead, this needs to update the statement plan and pass provider as an
option.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]