Repository navigation
fix: identify optimizer aliases with typed origins - #26769
Closed
mattsu2020 wants to merge 1 commit into
Closed
mattsu2020 wants to merge 1 commit into
mattsu2020 wants to merge 1 commit into
Conversation
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
This was referenced Oct 28, 2026
Contributor
|
Thanks for the contribution! I am closing this under DataFusion's AI Dump policy. This has the hallmarks of AI code that was not reviewed by the author: one of three sizable PRs opened the same day after claiming three unrelated issues, with a template validation section listing exact test counts and a new enum threaded across expr, optimizer and proto without prior design discussion. If you would like to continue, please open a focused PR in your own words that you have reviewed and understand, and we are happy to help with review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
__datafusion_extracted/__common_expralias prefix protocol with a typed marker #25449.Rationale for this change
A user alias such as
__datafusion_extracted_1can currently be mistaken for an optimizer-generated extraction. This lets an ordinary column name change how optimizer rules treat the expression. Plans built through the public API or restored from serialization have the same ambiguity.What changes are included in this PR?
AliasOrigin::{User, CommonSubexpr, LeafExtraction}. Mark generated definitions explicitly and use the origin to recognize leaf extractions.User; names are never used to infer the origin. Older readers can discard the new field.ExprandLogicalPlansizes of 112 and 176 bytes.SQL cannot encode the marker. The unparser continues to emit ordinary aliases, and reparsing gives them
Userorigins. This PR tests leaf-extraction SQL round trips; it retains the existing SQL reservation of__common_exprnames.What is the testing strategy for this PR?
Regression coverage includes:
__datafusion_extracted_1.Validation passed:
cargo fmt --alland the final formatting check.cargo clippy --all-targets --all-features -- -D warnings.projection_pushdown.slt.RUST_BACKTRACE=1 cargo test --profile ci \ --exclude datafusion-examples --exclude datafusion-benchmarks --exclude datafusion-cli \ --workspace --lib --tests --bins \ --features avro,json,backtrace,extended_tests,recursive_protection,parquet_encryptionCompared the five existing
optimize_projectionsbenchmark cases against Apache main at350ca76505c9513d16e7dd9910bcd9bde2c911ed, using theciprofile and sequential measurements without concurrent builds/tests. Point estimates ranged from -5.2% to +1.0%. These are unoptimized-profile measurements.Are there any user-facing changes?
User aliases beginning with
__datafusion_extractedare no longer identified as optimizer-generated solely from their names. Output column names remain intact.Public API changes:
Aliasgains anoriginfield andwith_origin(); existing alias constructors default toUser.Alias.metadatachanges fromOption<FieldMetadata>toOption<Box<FieldMetadata>>. Thewith_metadata()argument type remains unchanged.SavedName::Savedgains anoriginfield.The protobuf addition is optional, and SQL reserved-name validation is unchanged.