rctruta opened a new pull request, #27831:
URL: https://github.com/apache/datafusion/pull/27831
## Which issue does this PR close?
Follow-on to #27674 (per review feedback from @2010YOUY01 and @alamb)
## Rationale for this change
Running a `ContextProvider` with no registered functions is a valid
configuration, so failing to resolve a SQL function in that context should
return a `DataFusionError::Plan` (`plan_err!`) rather than
`DataFusionError::Internal` (`internal_err!`).
## What changes are included in this PR?
* `datafusion/sql/src/expr/function.rs`: Return `plan_err!("No functions
registered with this context.")` instead of `internal_err!(...)` when no
functions are registered in the context.
* `datafusion/sql/tests/sql_integration.rs`: Update the assertion in
`test_no_functions_registered` from `"Internal error: ..."` to `"Error during
planning: ..."`.
## What is the testing strategy for this PR?
Yes:
* `cargo test -p datafusion-sql`
* `cargo clippy -p datafusion-sql --all-targets --no-deps -- -D warnings`
* `cargo fmt -p datafusion-sql -- --check`
## Are there any user-facing changes?
Calling a SQL function against a context with no registered functions now
returns `DataFusionError::Plan ("Error during planning: No functions registered
with this context.")` instead of `DataFusionError::Internal`.
--
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]