mjgarton opened a new issue, #19840:
URL: https://github.com/apache/datafusion/issues/19840

   ### Describe the bug
   
   I'm attempting to implement the new `delete_from` method in my custom 
TableProvider implementation.  Despite a `DELETE` query with a where clause 
that matches a single record, I'm getting no filter expressions passed to 
`delete_from` leading to all data being deleted instead of a single record.
   
   What I currently believe is happening:
   1) My table provider supports push down filters.
   2) The datafusion pushes down the filters, so that instead of the 
ExecutionPlan being a Filter at the top level and having `TableScan` as its 
input value, the ExecutionPlan becomes `TableScan` which now contains the 
filters instead.
   3) In `extract_dml_filters` , the call to `TreeNode::apply` never reaches 
the filters inside the `TableScan` because `LogicalPlan::apply_children`  calls 
``LogicalPlan::inputs` which returns no children in the case where the top 
level of the LogicalPlan is a TableScan.
   
   If this explanation does not help, I will try to make a minimal reproduction 
case to show the problem.
   
   ### To Reproduce
   
   1) Try to delete a single record from a table via a TableProvider that 
supports Exact pushdown filters.
   2) Observe all records being deleted.
   
   ### Expected behavior
   
   Filters should be correctly passed to `delete_from`
   
   ### Additional context
   
   _No response_


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