diff --git a/datafusion/core/src/execution/context/mod.rs b/datafusion/core/src/execution/context/mod.rs index 4b7e7438b5e2..04debf498aa9 100644 --- a/datafusion/core/src/execution/context/mod.rs +++ b/datafusion/core/src/execution/context/mod.rs @@ -1392,8 +1392,8 @@ impl FunctionRegistry for SessionContext { self.state.write().register_function_rewrite(rewrite) } - fn user_defined_sql_planners(&self) -> Vec> { - self.state.read().user_defined_sql_planners() + fn expr_planners(&self) -> Vec> { + self.state.read().expr_planners() } fn register_user_defined_sql_planner( diff --git a/datafusion/core/src/execution/session_state.rs b/datafusion/core/src/execution/session_state.rs index cbddb091a3cc..ad557b12255c 100644 --- a/datafusion/core/src/execution/session_state.rs +++ b/datafusion/core/src/execution/session_state.rs @@ -1183,7 +1183,7 @@ impl FunctionRegistry for SessionState { Ok(()) } - fn user_defined_sql_planners(&self) -> Vec> { + fn expr_planners(&self) -> Vec> { self.user_defined_sql_planners.clone() } diff --git a/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs b/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs index 36f5c16fefe2..ae8a009c6292 100644 --- a/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs +++ b/datafusion/core/tests/user_defined/user_defined_scalar_functions.rs @@ -575,7 +575,7 @@ async fn test_user_defined_functions_cast_to_i64() -> Result<()> { async fn test_user_defined_sql_functions() -> Result<()> { let ctx = SessionContext::new(); - let sql_planners = ctx.user_defined_sql_planners(); + let sql_planners = ctx.expr_planners(); assert!(!sql_planners.is_empty()); diff --git a/datafusion/execution/src/task.rs b/datafusion/execution/src/task.rs index a80b4ffc6f3b..24d61e6a8b72 100644 --- a/datafusion/execution/src/task.rs +++ b/datafusion/execution/src/task.rs @@ -192,7 +192,7 @@ impl FunctionRegistry for TaskContext { Ok(self.scalar_functions.insert(udf.name().into(), udf)) } - fn user_defined_sql_planners(&self) -> Vec> { + fn expr_planners(&self) -> Vec> { vec![] } } diff --git a/datafusion/expr/src/registry.rs b/datafusion/expr/src/registry.rs index 64616d9b33f7..6a27c05bb451 100644 --- a/datafusion/expr/src/registry.rs +++ b/datafusion/expr/src/registry.rs @@ -111,7 +111,7 @@ pub trait FunctionRegistry { } /// Set of all registered [`UserDefinedSQLPlanner`]s - fn user_defined_sql_planners(&self) -> Vec>; + fn expr_planners(&self) -> Vec>; /// Registers a new [`UserDefinedSQLPlanner`] with the registry. fn register_user_defined_sql_planner( @@ -196,7 +196,7 @@ impl FunctionRegistry for MemoryFunctionRegistry { Ok(self.udwfs.insert(udaf.name().into(), udaf)) } - fn user_defined_sql_planners(&self) -> Vec> { + fn expr_planners(&self) -> Vec> { vec![] } } diff --git a/datafusion/proto/src/bytes/mod.rs b/datafusion/proto/src/bytes/mod.rs index 020f60d38992..83210cb4e41f 100644 --- a/datafusion/proto/src/bytes/mod.rs +++ b/datafusion/proto/src/bytes/mod.rs @@ -167,7 +167,7 @@ impl Serializeable for Expr { ) } - fn user_defined_sql_planners(&self) -> Vec> { + fn expr_planners(&self) -> Vec> { vec![] } } diff --git a/datafusion/proto/src/bytes/registry.rs b/datafusion/proto/src/bytes/registry.rs index a952b147b2b7..075993e2ba76 100644 --- a/datafusion/proto/src/bytes/registry.rs +++ b/datafusion/proto/src/bytes/registry.rs @@ -56,7 +56,7 @@ impl FunctionRegistry for NoRegistry { plan_err!("No function registry provided to deserialize, so can not deserialize User Defined Window Function '{}'", udwf.inner().name()) } - fn user_defined_sql_planners(&self) -> Vec> { + fn expr_planners(&self) -> Vec> { vec![] } }