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

Pass return type to the accumulator state factory in aggregates #3427

Closed
alamb opened this issue Sep 9, 2022 · 0 comments · Fixed by #3428
Closed

Pass return type to the accumulator state factory in aggregates #3427

alamb opened this issue Sep 9, 2022 · 0 comments · Fixed by #3428
Assignees
Labels
enhancement New feature or request

Comments

@alamb
Copy link
Contributor

alamb commented Sep 9, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I am working to expose "selector functions" in IOx, See https://github.com/influxdata/influxdb_iox/pull/5606 https://github.com/influxdata/influxdb_iox/issues/5528

I want to be able to call an aggregate that has different types based on its input arguments. There is sufficient flexibility in the return_type and state type factories, but the accumulator factory is not passed the output type, so I can't figure out any way to instantiate the correct internal implementation.

I can't defer the choice until runtime either because if no rows go in, I need to know how to produce the appropriate type of NULL value, which depends on the output type.

Describe the solution you'd like
Pass the return data type as an argument to the accumulator factory, consistent with the state type factory

Describe alternatives you've considered
I tried various ways around this and could not find any :(

Additional context
https://github.com/influxdata/influxdb_iox/pull/5606 https://github.com/influxdata/influxdb_iox/issues/5528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant