File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1669,10 +1669,11 @@ impl ContextProvider for SessionContextProvider<'_> {
16691669 name : & str ,
16701670 args : Vec < ( Expr , Option < String > ) > ,
16711671 ) -> datafusion_common:: Result < Arc < dyn TableSource > > {
1672+ let name = name. to_ascii_lowercase ( ) ;
16721673 let tbl_func = self
16731674 . state
16741675 . table_functions
1675- . get ( name)
1676+ . get ( & name)
16761677 . cloned ( )
16771678 . ok_or_else ( || plan_datafusion_err ! ( "table function '{name}' not found" ) ) ?;
16781679 let provider = tbl_func. create_table_provider ( & args) ?;
Original file line number Diff line number Diff line change @@ -434,12 +434,11 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
434434 _ => plan_err ! ( "Unsupported function argument: {arg:?}" ) ,
435435 } )
436436 . collect :: < Result < Vec < ( Expr , Option < String > ) > > > ( ) ?;
437- let tbl_func_name = tbl_func_ref. table ( ) . to_ascii_lowercase ( ) ;
438437 let provider = self
439438 . context_provider
440- . get_table_function_source ( & tbl_func_name , func_args) ?;
439+ . get_table_function_source ( tbl_func_ref . table ( ) , func_args) ?;
441440 let plan =
442- LogicalPlanBuilder :: scan ( tbl_func_name , provider, None ) ?. build ( ) ?;
441+ LogicalPlanBuilder :: scan ( tbl_func_ref . table ( ) , provider, None ) ?. build ( ) ?;
443442 ( plan, alias)
444443 }
445444 // @todo: Support TableFactory::TableFunction
You can’t perform that action at this time.
0 commit comments