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

Add Additional Aggregation Functions #29

Open
7 tasks
bcodell opened this issue Mar 29, 2023 · 0 comments
Open
7 tasks

Add Additional Aggregation Functions #29

bcodell opened this issue Mar 29, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@bcodell
Copy link
Collaborator

bcodell commented Mar 29, 2023

Description

It's technically outside of the Activity Schema spec, but it would be nice if the package shipped with additional aggregation functions to use with the aggregate relationships. Aggregations include:

  • average
  • median
  • listagg (available in Narrator)
  • listagg distinct
  • count distinct
  • boolean sum - convert boolean features to integers and sum them
  • not null - returns true if the feature has at least one non-null value, else false. Useful for sparse features.

Dependencies

Implementation

  • Add a macro for each aggregation with the naming convention _aggfunc_name.sql (e.g. _average.sql)
  • Implement each using the caller() implementation pattern (see example)
  • Register the aggregation in the Aggregation Registry

Checklist for each of the aggregations to implement:

  • average
  • median
  • listagg
  • listagg distinct
  • count distinct
  • boolean sum
  • not null

Open Questions

  • Are these reasonable to implement, even though they aren't included in the Activity Schema spec?
  • Do the aggregations specified make sense?
  • What other aggregations should be added?
@bcodell bcodell added the enhancement New feature or request label Mar 29, 2023
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

No branches or pull requests

1 participant