MCPcopy Create free account
hub / github.com/apache/datafusion / get_table_function_source

Method get_table_function_source

datafusion/core/src/execution/session_state.rs:1964–1997  ·  view source on GitHub ↗
(
        &self,
        name: &str,
        args: Vec<Expr>,
    )

Source from the content-addressed store, hash-verified

1962 }
1963
1964 fn get_table_function_source(
1965 &self,
1966 name: &str,
1967 args: Vec<Expr>,
1968 ) -> datafusion_common::Result<Arc<dyn TableSource>> {
1969 use datafusion_catalog::TableFunctionArgs;
1970
1971 let tbl_func = self
1972 .state
1973 .table_functions
1974 .get(name)
1975 .cloned()
1976 .ok_or_else(|| plan_datafusion_err!("table function '{name}' not found"))?;
1977 let simplify_context = SimplifyContext::builder()
1978 .with_config_options(Arc::clone(self.state.config_options()))
1979 .with_query_execution_start_time(
1980 self.state.execution_props().query_execution_start_time,
1981 )
1982 .build();
1983 let simplifier = ExprSimplifier::new(simplify_context);
1984 let schema = DFSchema::empty();
1985 let args = args
1986 .into_iter()
1987 .map(|arg| {
1988 simplifier
1989 .coerce(arg, &schema)
1990 .and_then(|e| simplifier.simplify(e))
1991 })
1992 .collect::<datafusion_common::Result<Vec<_>>>()?;
1993 let provider = tbl_func
1994 .create_table_provider_with_args(TableFunctionArgs::new(&args, self.state))?;
1995
1996 Ok(provider_as_source(provider))
1997 }
1998
1999 /// Create a new CTE work table for a recursive CTE logical plan
2000 /// This table will be used in conjunction with a Worktable physical plan

Callers

nothing calls this directly

Calls 15

newFunction · 0.85
provider_as_sourceFunction · 0.85
with_config_optionsMethod · 0.80
emptyFunction · 0.50
clonedMethod · 0.45
getMethod · 0.45
buildMethod · 0.45
config_optionsMethod · 0.45
execution_propsMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected