This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new db64743db1 Deprecate Expr::column_refs (#11115)
db64743db1 is described below
commit db64743db162f137ab3d2f8c8c3dabdb4d76016c
Author: Andrew Lamb <[email protected]>
AuthorDate: Tue Jun 25 19:14:00 2024 -0400
Deprecate Expr::column_refs (#11115)
---
datafusion/expr/src/expr.rs | 1 +
datafusion/expr/src/logical_plan/builder.rs | 9 ++++++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/datafusion/expr/src/expr.rs b/datafusion/expr/src/expr.rs
index 551f61ed5a..7f4301f135 100644
--- a/datafusion/expr/src/expr.rs
+++ b/datafusion/expr/src/expr.rs
@@ -1329,6 +1329,7 @@ impl Expr {
}
/// Return all referenced columns of this expression.
+ #[deprecated(since = "40.0.0", note = "use Expr::column_refs instead")]
pub fn to_columns(&self) -> Result<HashSet<Column>> {
let mut using_columns = HashSet::new();
expr_to_columns(self, &mut using_columns)?;
diff --git a/datafusion/expr/src/logical_plan/builder.rs
b/datafusion/expr/src/logical_plan/builder.rs
index 434f4dace1..4564a8c71f 100644
--- a/datafusion/expr/src/logical_plan/builder.rs
+++ b/datafusion/expr/src/logical_plan/builder.rs
@@ -39,7 +39,8 @@ use crate::logical_plan::{
use crate::type_coercion::binary::{comparison_coercion, values_coercion};
use crate::utils::{
can_hash, columnize_expr, compare_sort_expr, expand_qualified_wildcard,
- expand_wildcard, find_valid_equijoin_key_pair,
group_window_expr_by_sort_keys,
+ expand_wildcard, expr_to_columns, find_valid_equijoin_key_pair,
+ group_window_expr_by_sort_keys,
};
use crate::{
and, binary_expr, logical_plan::tree_node::unwrap_arc, DmlStatement, Expr,
@@ -1070,14 +1071,16 @@ impl LogicalPlanBuilder {
let left_key = l.into();
let right_key = r.into();
- let left_using_columns = left_key.to_columns()?;
+ let mut left_using_columns = HashSet::new();
+ expr_to_columns(&left_key, &mut left_using_columns)?;
let normalized_left_key =
normalize_col_with_schemas_and_ambiguity_check(
left_key,
&[&[self.plan.schema(), right.schema()]],
&[left_using_columns],
)?;
- let right_using_columns = right_key.to_columns()?;
+ let mut right_using_columns = HashSet::new();
+ expr_to_columns(&right_key, &mut right_using_columns)?;
let normalized_right_key =
normalize_col_with_schemas_and_ambiguity_check(
right_key,
&[&[self.plan.schema(), right.schema()]],
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]