apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
6.33k stars 1.2k forks source link

ScalarUDFImpl invoke improvements #13507

Open alamb opened 1 day ago

alamb commented 1 day ago

Builds on https://github.com/apache/datafusion/pull/13290 from @joseph-isaacs

Which issue does this PR close?

Rationale for this change

If we are going to change the signature of invoke I would to make it possible in the future to reuse allocations -- at the moment the API requires creating new arrays even when the input array is not used because the functions get the input as &[ColumnarValues] meaning they don't own them (the caller retains a reference)

What changes are included in this PR?

Change ScalarFunctionArgs to pass by value

1,

Are these changes tested?

Are there any user-facing changes?