-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Simplify AsyncScalarUdfImpl so it extends ScalarUdfImpl #16523
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
async fn invoke_async_with_args( | ||
&self, | ||
args: AsyncScalarFunctionArgs, | ||
args: ScalarFunctionArgs, |
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.
It is interesting here that invoke_async_with_args has a copy of the
config_options` 🤔 -- I think that is soemthing that @Omega359 has tried to get into normal scalar functions for a while
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.
It makes sense to me. We allow the custom config. Allowing access to the config option can make UDF flexible.
@@ -35,34 +35,7 @@ use std::sync::Arc; | |||
/// | |||
/// The name is chosen to mirror ScalarUDFImpl | |||
#[async_trait] | |||
pub trait AsyncScalarUDFImpl: Debug + Send + Sync { | |||
/// the function cast as any | |||
fn as_any(&self) -> &dyn Any; |
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 point of this PR is to remove this duplication from AsyncScalarUDFImpl
and instead use ScalarUDFImpl instead
I feel like there may be some more duplication we can remove as part of the PhysicalExpr layer too but I don't have time to pursue that at the moment. Maybe @goldmedal can give it a look |
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.
Thanks @alamb. Looks good to me 👍
async fn invoke_async_with_args( | ||
&self, | ||
args: AsyncScalarFunctionArgs, | ||
args: ScalarFunctionArgs, |
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.
It makes sense to me. We allow the custom config. Allowing access to the config option can make UDF flexible.
Thanks again for the review @goldmedal |
* Simplify AsyncScalarUdfImpl so it extends ScalarUdfImpl * Update one example * Update one example * prettier
Which issue does this PR close?
AsyncScalarUDFImpl
API to matchScalarUDFImpl
API #16522Rationale for this change
Following @berkaysynnada 's suggestion in #14837 having parallel implementations of functions allows sync and async UDFs to drift apart.
Let's try and make the differences as small as possible
What changes are included in this PR?
ScalarUdfImpl
Are these changes tested?
Are there any user-facing changes?
API is changed, but it has not been released yet so this is not an external API change