alamb commented on code in PR #16122:
URL: https://github.com/apache/datafusion/pull/16122#discussion_r2103200355
##########
datafusion/functions/src/datetime/now.rs:
##########
@@ -77,12 +77,13 @@ impl ScalarUDFImpl for NowFunc {
&self.signature
}
- fn return_field_from_args(&self, _args: ReturnFieldArgs) -> Result<Field> {
+ fn return_field_from_args(&self, _args: ReturnFieldArgs) ->
Result<FieldRef> {
Ok(Field::new(
Review Comment:
So in theory we could update this code to create the `FieldRef` once on
creation, and then return an `Arc::clone` rather than re-creating the Field
each time -- perhaps we can do that as some follow on PRs.
##########
datafusion/expr/src/expr_fn.rs:
##########
@@ -590,7 +591,7 @@ impl AggregateUDFImpl for SimpleAggregateUDF {
(self.accumulator)(acc_args)
}
- fn state_fields(&self, _args: StateFieldsArgs) -> Result<Vec<Field>> {
+ fn state_fields(&self, _args: StateFieldsArgs) -> Result<Vec<FieldRef>> {
Review Comment:
It is nice that this is now avoiding a deep copy of a bunch of `Field`s 👍
--
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]