alamb opened a new pull request, #8046: URL: https://github.com/apache/arrow-datafusion/pull/8046
## Which issue does this PR close? Builds on https://github.com/apache/arrow-datafusion/pull/8039 ## Rationale for this change This PR demonstrates what a function package API might look like by removing encoding expressions encode/decode from `BuiltInScalarFunction` enum and adding it in a separate crate (`datafusion-functions`) ## What changes are included in this PR? 1. A new `FunctionImplementation` trait and integration into `ScalarUDF` to make it easier to write ScalarUDFs; 2. a new `datafusion-functions` crate that has the implementation of `encode` and `decode`. 3. Automatically register these functions as part of `SessionState::new()`, similarly to the automatically registered `ListingTable`s 4. TODO optional enabling of functions based on feature flag Open Questions: 1. to support the `expr_fn`s [encode](https://docs.rs/datafusion/latest/datafusion/logical_expr/expr_fn/fn.encode.html) and [decode](https://docs.rs/datafusion/latest/datafusion/logical_expr/expr_fn/fn.decode.html), I think we will need a `Expr::ScalarFunction` call or something that can take a function by name rather than fully resolved function 2. Extract registration functions from SessionContext into their own trait / consolidate the function registry code rather than passing around a set of HahsMaps.... And make a way to actually modify them ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. --> -- 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]
