Skip to content

Commit 3b52146

Browse files
committed
Get table function in ascii lowercase
1 parent 20f68d1 commit 3b52146

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

datafusion/core/src/execution/session_state.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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)?;

datafusion/sql/src/relation/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)