ScalarUDF: Remove supports_zero_argument
and avoid creating null array for empty args
#10205
Labels
enhancement
New feature or request
Is your feature request related to a problem or challenge?
File an issue to discuss about design in #10193, since it is no longer a minor change
Previously, we always provided a null array if the function supports zero args, like
random(), pi(), make_array()
.I think the additional null array should not provided for all the function that supports 0 args, instead handle case by case in each function. It turns out the null array is not useful either.
random
,pi
, anduuid
takes the number of rows instead of the actual null array.We need to design an alternative way to communicate the number of rows to the function.
Proposal 1:
Add
support_randomness -> bool
toScalarUDFImpl
, and we provide the number of rows as the first argument forinvoke
.Proposal 2:
We always provide the number of rows to
invoke
.Change from
to
It is more aggressive and breaks the signature, but
batch
is part of theevaluate()
, provide information aboutbatch
andargs
toinvoke()
makes sense to me.Proposol 3 from alamb
Introduce another function with batch rows only.
#10205 (comment)
We need
support_randomness -> bool
, so we know to switch toinvoke_no_args
.Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
I decide to go for 3, since there are already over 100
invoke()
used, not worth to break the signatureThe text was updated successfully, but these errors were encountered: