kosiew commented on code in PR #20061:
URL: https://github.com/apache/datafusion/pull/20061#discussion_r2745663790
##########
datafusion/core/src/physical_planner.rs:
##########
@@ -1968,9 +2115,16 @@ fn extract_dml_filters(input: &Arc<LogicalPlan>) ->
Result<Vec<Expr>> {
let mut filters = Vec::new();
input.apply(|node| {
- if let LogicalPlan::Filter(filter) = node {
- // Split AND predicates into individual expressions
-
filters.extend(split_conjunction(&filter.predicate).into_iter().cloned());
+ match node {
+ LogicalPlan::Filter(filter) => {
+ // Split AND predicates into individual expressions
+
filters.extend(split_conjunction(&filter.predicate).into_iter().cloned());
+ }
+ LogicalPlan::TableScan(scan) => {
+ // Also extract filters from TableScan (where they may be
pushed down)
+ filters.extend(scan.filters.iter().cloned());
Review Comment:
I think this would be a problem in scenarios like `UPDATE target FROM source
...` where the input plan contains `TableScan` nodes for both `target` and
`source`. This function will extract filters from *both* tables and attempt to
apply them to the `target` table (after stripping qualifiers).
--
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]