@@ -193,7 +193,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
193193 }
194194 }
195195
196- not_impl_err ! ( "Extract not supported by UserDefinedExtensionPlanners : {extract_args:?}" )
196+ not_impl_err ! ( "Extract not supported by ExprPlanner : {extract_args:?}" )
197197 }
198198
199199 SQLExpr :: Array ( arr) => self . sql_array_literal ( arr. elem , schema) ,
@@ -292,7 +292,9 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
292292 }
293293 }
294294
295- not_impl_err ! ( "GetFieldAccess not supported by UserDefinedExtensionPlanners: {field_access_expr:?}" )
295+ not_impl_err ! (
296+ "GetFieldAccess not supported by ExprPlanner: {field_access_expr:?}"
297+ )
296298 }
297299
298300 SQLExpr :: CompoundIdentifier ( ids) => {
@@ -657,7 +659,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
657659 PlannerResult :: Original ( args) => create_struct_args = args,
658660 }
659661 }
660- not_impl_err ! ( "Struct not supported by UserDefinedExtensionPlanners : {create_struct_args:?}" )
662+ not_impl_err ! ( "Struct not supported by ExprPlanner : {create_struct_args:?}" )
661663 }
662664
663665 fn sql_position_to_expr (
@@ -680,9 +682,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
680682 }
681683 }
682684
683- not_impl_err ! (
684- "Position not supported by UserDefinedExtensionPlanners: {position_args:?}"
685- )
685+ not_impl_err ! ( "Position not supported by ExprPlanner: {position_args:?}" )
686686 }
687687
688688 fn try_plan_dictionary_literal (
@@ -914,26 +914,26 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
914914 schema : & DFSchema ,
915915 planner_context : & mut PlannerContext ,
916916 ) -> Result < Expr > {
917- let fun = self
918- . context_provider
919- . get_function_meta ( "overlay" )
920- . ok_or_else ( || {
921- internal_datafusion_err ! ( "Unable to find expected 'overlay' function" )
922- } ) ?;
923917 let arg = self . sql_expr_to_logical_expr ( expr, schema, planner_context) ?;
924918 let what_arg =
925919 self . sql_expr_to_logical_expr ( overlay_what, schema, planner_context) ?;
926920 let from_arg =
927921 self . sql_expr_to_logical_expr ( overlay_from, schema, planner_context) ?;
928- let args = match overlay_for {
922+ let mut overlay_args = match overlay_for {
929923 Some ( for_expr) => {
930924 let for_expr =
931925 self . sql_expr_to_logical_expr ( * for_expr, schema, planner_context) ?;
932926 vec ! [ arg, what_arg, from_arg, for_expr]
933927 }
934928 None => vec ! [ arg, what_arg, from_arg] ,
935929 } ;
936- Ok ( Expr :: ScalarFunction ( ScalarFunction :: new_udf ( fun, args) ) )
930+ for planner in self . planners . iter ( ) {
931+ match planner. plan_overlay ( overlay_args) ? {
932+ PlannerResult :: Planned ( expr) => return Ok ( expr) ,
933+ PlannerResult :: Original ( args) => overlay_args = args,
934+ }
935+ }
936+ not_impl_err ! ( "Overlay not supported by ExprPlanner: {overlay_args:?}" )
937937 }
938938}
939939
0 commit comments