apache / apache/datafusion

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

Open
#19,272 2 comments 0 reactions 1 assignee Claimed by @shifluxxc View on GitHub
bug
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.