From 92ac4cb4b97136c6ab9a3f2343c4d265d354c61b Mon Sep 17 00:00:00 2001 From: Xin Li Date: Thu, 4 Jul 2024 18:09:14 +0800 Subject: [PATCH] Move planner to session_state --- datafusion/core/src/execution/session_state.rs | 2 ++ datafusion/functions/src/unicode/planner.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/datafusion/core/src/execution/session_state.rs b/datafusion/core/src/execution/session_state.rs index a831f92def50..ffaaa2df5e7e 100644 --- a/datafusion/core/src/execution/session_state.rs +++ b/datafusion/core/src/execution/session_state.rs @@ -240,6 +240,8 @@ impl SessionState { Arc::new(functions_array::planner::FieldAccessPlanner), #[cfg(feature = "datetime_expressions")] Arc::new(functions::datetime::planner::ExtractPlanner), + #[cfg(feature = "unicode_expressions")] + Arc::new(functions::unicode::planner::PositionPlanner), ]; let mut new_self = SessionState { diff --git a/datafusion/functions/src/unicode/planner.rs b/datafusion/functions/src/unicode/planner.rs index d3f9db324beb..4d6f73321b4a 100644 --- a/datafusion/functions/src/unicode/planner.rs +++ b/datafusion/functions/src/unicode/planner.rs @@ -25,7 +25,7 @@ use datafusion_expr::{ }; #[derive(Default)] -pub struct PositionPlanner {} +pub struct PositionPlanner; impl UserDefinedSQLPlanner for PositionPlanner { fn plan_position(&self, args: Vec) -> Result>> {