Skip to content
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

Feature/instance udfs #890

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

timsaucer
Copy link
Contributor

Which issue does this PR close?

Closes #822

Rationale for this change

With this change we add an additional argument to udaf and udwf to be used for calls to __init__ of the class that implements the aggregation or partition evaluator. This allows users to pass in these arguments so we can reuse a single class that requires parameters.

The other option is to always pass in these parameters as lit() values which is not as performant.

What changes are included in this PR?

Updates the udaf call to add in the provided arguments when initializing the classes. Also adds unit tests.

Are there any user-facing changes?

There is a non-breaking change to the udaf function that allows for an optional set of arguments to be passed in. If any users are instead calling AggregateUDF() directly they will need to add in an empty list as the extra argument.

There is a breaking change to udwf but since it is not in any released version yet, it shouldn't count as a user-facing change in my opinion.

@timsaucer timsaucer self-assigned this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance udf to take additional non-expr arguments
1 participant