| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #24756 +/- ##
==========================================
- Coverage 81.48% 81.48% -0.01%
==========================================
Files 1122 1122
Lines 404248 404248
Branches 404248 404248
==========================================
- Hits 329390 329386 -4
Misses 55547 55547
- Partials 19311 19315 +4 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
RelationPlanning::Planned and RelationPlanning::Original began taking boxed values in apache@e8efd59, merged through apache#19672. The extending SQL guide retained the old constructors, so update the example to match the current API.
| Back | FazBrowse Home | New Git URL |
Which issue does this PR close?
Rationale for this change
The official TABLESAMPLE relation-planner example currently applies a relation alias twice. It recursively plans the underlying table while the alias is still attached, then returns that same alias with the completed sampled plan. RelationPlannerContext::plan(...) applies the first copy, and DataFusion applies PlannedRelation::alias a second time.
This is subtle enough to miss in review, and the example is doing its job a little too well: VGI copied the same recursive-planning shape and returns the alias again.
The intended ownership rule is simple: remove the outer alias before recursively planning an inner relation, then return that alias with the finished extension plan so DataFusion applies it once, around the whole relation.
What changes are included in this PR?
Are these changes tested?
Yes. The test checks the complete logical-plan shape and verifies that the relation alias and each column rename appear exactly once. As an ablation check, restoring the old alias.clone() line makes the test fail with two SubqueryAlias nodes and duplicate rename projections.
I also ran the focused example test, example compilation, cargo fmt --all, the required all-target/all-feature Clippy command with warnings denied, Rustdoc for datafusion-expr, and the documentation Prettier check.
Are there any user-facing changes?
The core planner's alias behavior is unchanged. The user-facing changes are a corrected official example and clearer documentation for extension authors.