Skip to content

Conversation

@Michael-J-Ward
Copy link
Contributor

@Michael-J-Ward Michael-J-Ward commented Jun 25, 2024

Part of #727
Ref #730

Which issue does this PR close?

  • Provides releasable workaround for but does not close Upgrade window UDF api #730.
  • Provides python compatibility for sqlparser::ast::NullTreatment which is now part of the UDAF api.

Rationale for this change

AggregateFunction::Sum enum variant is still defined upstream, but can not be used.

I suspect that the proper solution is to register the new UDAFs with the function registry.
But I'm unsure how that machinery should work.

As a workaround for releasing 39, I explicitly match on name == "sum" and redirect to the UDAF.

Are there any user-facing changes?

They get a new NullTreatment option.

Additional Context

I am uncertain about the design choices here, so please be critical.

Even if you choose to release this for v39, let me know how to improve it for next release.

This is now exposed as part of the API to `first_value` and `last_value` functions.

If there's a more elegant way to achieve this, please let me know.
@andygrove andygrove merged commit ec835ab into apache:main Jun 26, 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.

Upgrade window UDF api

2 participants