imback82 commented on a change in pull request #30636:
URL: https://github.com/apache/spark/pull/30636#discussion_r537984180
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCommandsWithIfExists.scala
##########
@@ -17,17 +17,19 @@
package org.apache.spark.sql.catalyst.analysis
-import org.apache.spark.sql.catalyst.plans.logical.{DropTable, LogicalPlan,
NoopDropTable}
+import org.apache.spark.sql.catalyst.plans.logical.{DropTable, DropView,
LogicalPlan, NoopCommand}
import org.apache.spark.sql.catalyst.rules.Rule
/**
- * A rule for handling [[DropTable]] logical plan when the table or temp view
is not resolved.
- * If "ifExists" flag is set to true, the plan is resolved to
[[NoopDropTable]],
- * which is a no-op command.
+ * A rule for handling commands when the table or temp view is not resolved.
+ * These commands support a flag, "ifExists", so that they do not fail when a
relation is not
+ * resolved. If the "ifExists" flag is set to true. the plan is resolved to
[[NoopCommand]],
*/
-object ResolveNoopDropTable extends Rule[LogicalPlan] {
+object ResolveCommandsWithIfExists extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperatorsUp {
case DropTable(u: UnresolvedTableOrView, ifExists, _) if ifExists =>
- NoopDropTable(u.multipartIdentifier)
+ NoopCommand(u.multipartIdentifier)
+ case DropView(u: UnresolvedView, ifExists) if ifExists =>
+ NoopCommand(u.multipartIdentifier)
Review comment:
Thanks, added.
----------------------------------------------------------------
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]