Skip to content

[FEA] Remove simple_aggregations_collector and aggregation_finalizer classes in groupby aggregation #21059

@ttnghia

Description

@ttnghia

Is your feature request related to a problem? Please describe.
Currently, simple_aggregations_collector and aggregation_finalizer classes are base classes to support some kind of preprocessing/post processing for compound aggregations. The way they are implemented, however, is very lengthy and incurs a lot of maintenence. For instance, these classes define a lot of visit overload for every aggregation type, and each corresponding class of such aggregation type has to override a finalize function that does nothing in most cases.

Describe the solution you'd like
We can achieve the same purpose with better, shorter implementation. Let's remove these classes completely, as well as all the corresponding functions in the aggregation classes. Then:

  • Implement template functors to replace each of these removed classes. The functors look like template<aggregation::Kind> struct simple_aggregation_collector{}; and ``templateaggregation::Kind struct aggregation_finalizer{};`.
  • For each of these, we implement explicitly specialization the functor for the aggregation types that need special treatment. We still need explicit specialization for the default case. Whenver we need to do preprocessing/postprocessing, we can call an aggregation type dispatcher, pass in the aggregation object along with other parameters that execute the corresponding specialization of the functor and return the desired result.

Describe alternatives you've considered
N/A.

Additional context
N/A.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions