(
&self,
name: &str,
args: Vec<Expr>,
)
| 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 |
nothing calls this directly
no test coverage detected