-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ScalarUDFImpl invoke improvements #13507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…invoke is passed the return type created for the udf instance
// evaluate the function | ||
let output = self.fun.invoke_batch(&inputs, batch.num_rows())?; | ||
let output = self.fun.invoke_with_args(ScalarFunctionArgs { | ||
args: inputs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the whole point of this PR is to pass in inputs
here rather than inputs.as_ref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually we should probably consider doing the same thing for evaluate
🤔
Can we have one example function doing that, with some tests proving this indeed works? |
Just OCD following up here, there is an example / tests in this PR: |
Builds on #13290 from @joseph-isaacs
Which issue does this PR close?
ScalarUDFImpl::invoke_with_args
to support passing the return type created for the udf instance #13290Rationale 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?