(
&self,
name: &str,
)
| 973 | } |
| 974 | |
| 975 | pub(super) fn find_window_func( |
| 976 | &self, |
| 977 | name: &str, |
| 978 | ) -> Result<WindowFunctionDefinition> { |
| 979 | // Check udaf first |
| 980 | let udaf = self.context_provider.get_aggregate_meta(name); |
| 981 | // Use the builtin window function instead of the user-defined aggregate function |
| 982 | if udaf.as_ref().is_some_and(|udaf| { |
| 983 | udaf.name() != "first_value" |
| 984 | && udaf.name() != "last_value" |
| 985 | && udaf.name() != "nth_value" |
| 986 | }) { |
| 987 | Ok(WindowFunctionDefinition::AggregateUDF(udaf.unwrap())) |
| 988 | } else { |
| 989 | self.context_provider |
| 990 | .get_window_meta(name) |
| 991 | .map(WindowFunctionDefinition::WindowUDF) |
| 992 | .ok_or_else(|| { |
| 993 | plan_datafusion_err!("There is no window function named {name}") |
| 994 | }) |
| 995 | } |
| 996 | } |
| 997 | |
| 998 | fn sql_fn_arg_to_logical_expr( |
| 999 | &self, |
no test coverage detected