-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Labels
bugSomething isn't workingSomething isn't working
Description
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:
- My table provider supports push down filters.
- The datafusion pushes down the filters, so that instead of the ExecutionPlan being a Filter at the top level and having
TableScanas its input value, the ExecutionPlan becomesTableScanwhich now contains the filters instead. - In
extract_dml_filters, the call toTreeNode::applynever reaches the filters inside theTableScanbecauseLogicalPlan::apply_childrencalls ``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
- Try to delete a single record from a table via a TableProvider that supports Exact pushdown filters.
- Observe all records being deleted.
Expected behavior
Filters should be correctly passed to delete_from
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working