rdblue commented on a change in pull request #24686: [SPARK-27813][SQL]
DataSourceV2: Add DropTable logical operation
URL: https://github.com/apache/spark/pull/24686#discussion_r287496326
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
##########
@@ -640,11 +641,20 @@ class SparkSqlAstBuilder(conf: SQLConf) extends
AstBuilder(conf) {
* Create a [[DropTableCommand]] command.
*/
override def visitDropTable(ctx: DropTableContext): LogicalPlan =
withOrigin(ctx) {
- DropTableCommand(
- visitTableIdentifier(ctx.tableIdentifier),
- ctx.EXISTS != null,
- ctx.VIEW != null,
- ctx.PURGE != null)
+ visitMultipartIdentifier(ctx.multipartIdentifier()) match {
Review comment:
The way we do this for `CreateTable` is to parse to an intermediate
representation, `CreateTableStatement` that contains exactly what was parsed.
Then translation to v1 `DropTableCommand` or v2 `DropTable` can be done in an
analyzer rule. That way, the parser and the analyzer stay separate and the
parser implementation for `DROP TABLE` can be kept in Catalyst.
I think this should take the same approach.
----------------------------------------------------------------
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]