Skip to content

Commit 232c974

Browse files
committed
use GetIndexedFieldExpr directly
1 parent 2fd5220 commit 232c974

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
@@ -65,7 +65,7 @@ pub use cast::{
6565
pub use column::{col, Column};
6666
pub use count::Count;
6767
pub use cume_dist::cume_dist;
68-
pub use get_indexed_field::{get_indexed_field, GetIndexedFieldExpr};
68+
pub use get_indexed_field::GetIndexedFieldExpr;
6969
pub use in_list::{in_list, InListExpr};
7070
pub use is_not_null::{is_not_null, IsNotNullExpr};
7171
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;
@@ -969,10 +971,18 @@ impl DefaultPhysicalPlanner {
969971
Expr::IsNotNull(expr) => expressions::is_not_null(
970972
self.create_physical_expr(expr, input_dfschema, input_schema, ctx_state)?,
971973
),
972-
Expr::GetIndexedField { expr, key } => expressions::get_indexed_field(
973-
self.create_physical_expr(expr, input_dfschema, input_schema, ctx_state)?,
974-
key.clone(),
975-
),
974+
Expr::GetIndexedField { expr, key } => {
975+
Ok(Arc::new(GetIndexedFieldExpr::new(
976+
self.create_physical_expr(
977+
expr,
978+
input_dfschema,
979+
input_schema,
980+
ctx_state,
981+
)?,
982+
key.clone(),
983+
)))
984+
}
985+
976986
Expr::ScalarFunction { fun, args } => {
977987
let physical_args = args
978988
.iter()

0 commit comments

Comments
 (0)