mattsu2020 opened a new pull request, #25954:
URL: https://github.com/apache/datafusion/pull/25954

   ## Which issue does this PR close?
   
   - Closes #10628.
   
   ## Rationale for this change
   
   Users need concrete examples of inspecting and rewriting `LogicalPlan` trees 
with the `TreeNode` APIs, including subqueries embedded in expressions.
   
   ## What changes are included in this PR?
   
   - Extend the `LogicalPlan` rustdoc example to collect table names with 
`TreeNode::apply`.
   - Add a tested `TreeNode::rewrite` example that removes Filter nodes, 
explaining traversal order and the change in query semantics.
   - Add the `query_planning -- plan_walk` example demonstrating plan 
inspection, stateful rewriting, subquery traversal, and collecting predicates 
from both Filter nodes and TableScan filters.
   - Register the example in the query planning runner and update the generated 
examples README.
   
   ## What is the testing strategy for this PR?
   
   The rustdoc examples and assertions in the executable example verify the 
collected table names, rewritten plan, subquery traversal, and filter 
predicates.
   
   - `cargo test --profile ci -p datafusion-expr --doc 
logical_plan::plan::LogicalPlan` (8 passed)
   - `cargo run --profile ci -p datafusion-examples --example query_planning -- 
plan_walk`
   - `cargo fmt --all`
   - `cargo clippy --all-targets --all-features -- -D warnings`
   - `./ci/scripts/doc_prettier_check.sh --write --allow-dirty`
   - `./dev/rust_lint.sh` (run via `uv run --package datafusion-dev --with 
PyYAML`)
   
   ## Are there any user-facing changes?
   
   The API documentation now includes additional plan walking and rewriting 
examples and links to an executable walkthrough. There are no changes to query 
execution or public APIs.
   


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