rctruta commented on code in PR #27674:
URL: https://github.com/apache/datafusion/pull/27674#discussion_r4682410841
##########
datafusion/sql/src/expr/function.rs:
##########
@@ -957,17 +983,31 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
}
// Could not find the relevant function, so return an error
+ let has_functions = if is_function_window {
+ !self.context_provider.udaf_names().is_empty()
+ || !self.context_provider.udwf_names().is_empty()
+ } else {
+ !self.context_provider.udf_names().is_empty()
+ || !self
+ .context_provider
+ .higher_order_function_names()
+ .is_empty()
+ || !self.context_provider.udaf_names().is_empty()
+ };
+ if !has_functions {
+ return internal_err!("No functions registered with this context.");
Review Comment:
Thank you for the review!
I kept `internal_err!` here because
`datafusion/sql/tests/sql_integration.rs:5641` explicitly asserts `"Internal
error: No functions registered with this context."`. Happy to switch **both**
to `plan_err!` in this PR if you'd prefer, or leave it as-is to keep this PR
scoped to #27673.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]