Skip to content

Commit bfb82de

Browse files
committed
use GetIndexedFieldExpr directly
1 parent 30197d6 commit bfb82de

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

datafusion/src/physical_plan/expressions/get_indexed_field.rs

-8
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,3 @@ impl PhysicalExpr for GetIndexedFieldExpr {
101101
}
102102
}
103103
}
104-
105-
/// Create a `.[field]` expression
106-
pub fn get_indexed_field(
107-
arg: Arc<dyn PhysicalExpr>,
108-
key: ScalarValue,
109-
) -> Result<Arc<dyn PhysicalExpr>> {
110-
Ok(Arc::new(GetIndexedFieldExpr::new(arg, key)))
111-
}

datafusion/src/physical_plan/expressions/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub use cast::{
6767
pub use column::{col, Column};
6868
pub use count::Count;
6969
pub use cume_dist::cume_dist;
70-
pub use get_indexed_field::{get_indexed_field, GetIndexedFieldExpr};
70+
pub use get_indexed_field::GetIndexedFieldExpr;
7171
pub use in_list::{in_list, InListExpr};
7272
pub use is_not_null::{is_not_null, IsNotNullExpr};
7373
pub use is_null::{is_null, IsNullExpr};

datafusion/src/physical_plan/planner.rs

+15-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ use crate::physical_optimizer::optimizer::PhysicalOptimizerRule;
3232
use crate::physical_plan::cross_join::CrossJoinExec;
3333
use crate::physical_plan::explain::ExplainExec;
3434
use crate::physical_plan::expressions;
35-
use crate::physical_plan::expressions::{CaseExpr, Column, Literal, PhysicalSortExpr};
35+
use crate::physical_plan::expressions::{
36+
CaseExpr, Column, GetIndexedFieldExpr, Literal, PhysicalSortExpr,
37+
};
3638
use crate::physical_plan::filter::FilterExec;
3739
use crate::physical_plan::hash_aggregate::{AggregateMode, HashAggregateExec};
3840
use crate::physical_plan::hash_join::HashJoinExec;
@@ -993,10 +995,18 @@ impl DefaultPhysicalPlanner {
993995
Expr::IsNotNull(expr) => expressions::is_not_null(
994996
self.create_physical_expr(expr, input_dfschema, input_schema, ctx_state)?,
995997
),
996-
Expr::GetIndexedField { expr, key } => expressions::get_indexed_field(
997-
self.create_physical_expr(expr, input_dfschema, input_schema, ctx_state)?,
998-
key.clone(),
999-
),
998+
Expr::GetIndexedField { expr, key } => {
999+
Ok(Arc::new(GetIndexedFieldExpr::new(
1000+
self.create_physical_expr(
1001+
expr,
1002+
input_dfschema,
1003+
input_schema,
1004+
ctx_state,
1005+
)?,
1006+
key.clone(),
1007+
)))
1008+
}
1009+
10001010
Expr::ScalarFunction { fun, args } => {
10011011
let physical_args = args
10021012
.iter()

0 commit comments

Comments
 (0)