-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate more code from Expr::to_columns
to Expr::column_refs
#11067
Conversation
@@ -1259,7 +1259,7 @@ impl DefaultPhysicalPlanner { | |||
let join_filter = match filter { | |||
Some(expr) => { | |||
// Extract columns from filter expression and saved in a HashSet | |||
let cols = expr.to_columns()?; | |||
let cols = expr.column_refs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this saves copying all the Column
s (which have owned strings in them)
datafusion/optimizer/src/utils.rs
Outdated
/// Returns true if all columns in col_refs are in `schema_cols` | ||
/// | ||
/// Note: can't use `HashSet::intersect` here because they have different types. | ||
pub(crate) fn has_all_refs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can rename it to better reflect if all columns in col_refs are in
schema_cols` ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in d4346f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm thanks @alamb
…che#11067) * Migrate code from `Expr::to_columns` to `Expr::column_refs`
Which issue does this PR close?
Part of #10505
Rationale for this change
We made an API to find column references without copying strings in #10948 and we should use it more.
What changes are included in this PR?
Expr::column_refs
API introduced in Add Expr::column_refs to find column references without copying #10948 to avoid copyingAre these changes tested?
Covered by existing CI
Are there any user-facing changes?
No (though perhaps slightly faster planning)