datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

LogicalPlan::map_children should recurse into table scans defined by a plan

Open leoyvens opened this issue 4 weeks ago • 2 comments

Describe the bug

This is about the TreeNode impl for LogicalPlan. Some LogicalPlan::TableScan are not actually leaves because they are defined by a logical plan. However here: https://github.com/apache/datafusion/blob/321401ce627c586703f3b8902831bbe4578c5a9b/datafusion/expr/src/logical_plan/tree_node.rs#L348-L349

The fn map_children is unconditionally assuming that the table scan is a leaf and has no children.

The correct behaviour would be to recurse into the plan, if one exists.

leoyvens avatar Dec 10 '25 22:12 leoyvens

take

shifluxxc avatar Dec 11 '25 07:12 shifluxxc

@leoyvens can you please review the changes .

shifluxxc avatar Dec 11 '25 14:12 shifluxxc