aokolnychyi commented on a change in pull request #35395:
URL: https://github.com/apache/spark/pull/35395#discussion_r815234852



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala
##########
@@ -446,17 +501,52 @@ object DescribeColumn {
   def getOutputAttrs: Seq[Attribute] = 
DescribeCommandSchema.describeColumnAttributes()
 }
 
+trait RowLevelCommand extends Command with SupportsSubquery {
+  def condition: Expression
+  def rewritePlan: Option[LogicalPlan]
+  def withNewRewritePlan(newRewritePlan: LogicalPlan): RowLevelCommand
+}
+
 /**
  * The logical plan of the DELETE FROM command.
  */
 case class DeleteFromTable(
     table: LogicalPlan,
-    condition: Option[Expression]) extends UnaryCommand with SupportsSubquery {
-  override def child: LogicalPlan = table
-  override protected def withNewChildInternal(newChild: LogicalPlan): 
DeleteFromTable =
-    copy(table = newChild)
+    condition: Expression,

Review comment:
       @viirya @rdblue @cloud-fan @huaxingao, a question. In all rules I added, 
having checks for None and Some(true), which are essentially the same thing, 
complicated the implementation. I made the condition required and default it to 
true in the parser. What do you think?




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to