alamb commented on code in PR #14541:
URL: https://github.com/apache/datafusion/pull/14541#discussion_r1946707537
##########
datafusion/expr/src/udaf.rs:
##########
@@ -119,9 +119,12 @@ impl AggregateUDF {
where
F: AggregateUDFImpl + 'static,
{
- Self {
- inner: Arc::new(fun),
- }
+ Self::new_from_shared_impl(Arc::new(fun))
+ }
+
+ /// Create a new `AggregateUDF` from a `[AggregateUDFImpl]` trait object
Review Comment:
I suggest also adding `From` impls for these functions similar to
https://github.com/apache/datafusion/blob/4f6062e81b7201b58da2b20c63333a5e3ae3c8df/datafusion/expr/src/udaf.rs#L288-L295
That would allow creation using
```rust
let fun: fun: Arc<dyn AggregateUDFImpl> = ...;
// create using `from`:
let new_func = AggregateUDFImpl::from(fun);
```
--
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]