martin-g commented on code in PR #24655:
URL: https://github.com/apache/datafusion/pull/24655#discussion_r3870540552


##########
datafusion/catalog/src/memory/table.rs:
##########
@@ -361,71 +363,24 @@ impl MemTable {
         state: &'a dyn Session,
         filters: Vec<Expr>,
     ) -> BoxFuture<'a, Result<Arc<dyn ExecutionPlan>>> {
-        Box::pin(self.delete_from_inner(state, filters))
+        Box::pin(ready(self.plan_delete(state, filters)))
     }
 
-    async fn delete_from_inner(
+    /// Build the plan of a DELETE. The rows change when the plan runs, not 
here.
+    fn plan_delete(
         &self,
         state: &dyn Session,
         filters: Vec<Expr>,
     ) -> Result<Arc<dyn ExecutionPlan>> {
         // Early exit if table has no partitions
         if self.batches.is_empty() {
-            return Ok(Arc::new(DmlResultExec::new(0)));
+            return Ok(self.dml_exec(vec![], vec![], MemDmlOp::Delete));

Review Comment:
   Old behavior. I am not sure whether it should be changed or not.
   `EXPLAIN DELETE FROM empty_table WHERE nonexistent = 1` will return 
successfully without complaining that there is no column named `nonexistent`.
   



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