Class AggregationProcessor
java.lang.Object
io.deephaven.engine.table.impl.by.AggregationProcessor
- All Implemented Interfaces:
AggregationContextFactory
Conversion tool to generate an
AggregationContextFactory for a collection of aggregations.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic AggregationContextFactoryforAggregation(@NotNull Collection<? extends Aggregation> aggregations) Convert a collection ofaggregationsto anAggregationContextFactory.static AggregationContextFactoryCreate a trivialAggregationContextFactorytogroupthe input table and expose the grouprow setsasEXPOSED_GROUP_ROW_SETS.static AggregationContextFactoryforRollupBase(@NotNull Collection<? extends Aggregation> aggregations, boolean includeConstituents, @NotNull ColumnName rollupColumn) Convert a collection ofaggregationsto anAggregationContextFactoryfor use in computing the base level of a rollup.static AggregationContextFactoryforRollupReaggregated(@NotNull Collection<? extends Aggregation> aggregations, @NotNull Collection<ColumnDefinition<?>> nullColumns, @NotNull ColumnName rollupColumn) Convert a collection ofaggregationsto anAggregationContextFactoryfor use in computing a reaggregated level of a rollup.static AggregationContextFactoryforRollupReaggregatedLeaf(@NotNull Collection<? extends Aggregation> aggregations, @NotNull Collection<ColumnDefinition<?>> nullColumns, @NotNull ColumnName rollupColumn) Convert a collection ofaggregationsto anAggregationContextFactoryfor use in computing a reaggregated table, but without the ability to descend to the lower level (the rollupColumn is null).static AggregationContextFactoryCreate a trivialAggregationContextFactoryto implementselect distinct.static AggregationContextFactoryCreate a trivialAggregationContextFactoryto implement source-row lookup functionality fortree.static AggregationRowLookupgetRowLookup(@NotNull Table aggregationResult) makeAggregationContext(@NotNull Table table, boolean requireStateChangeRecorder, @NotNull String... groupByColumnNames) Make anAggregationContextfor this aggregation.toString()
-
Field Details
-
EXPOSED_GROUP_ROW_SETS
-
-
Method Details
-
forAggregation
public static AggregationContextFactory forAggregation(@NotNull @NotNull Collection<? extends Aggregation> aggregations) Convert a collection ofaggregationsto anAggregationContextFactory.- Parameters:
aggregations- Theaggregations. Must not be further mutated by the caller. Will not be mutated byAggregationProcessor.- Returns:
- The
AggregationContextFactory
-
forRollupBase
public static AggregationContextFactory forRollupBase(@NotNull @NotNull Collection<? extends Aggregation> aggregations, boolean includeConstituents, @NotNull @NotNull ColumnName rollupColumn) Convert a collection ofaggregationsto anAggregationContextFactoryfor use in computing the base level of a rollup.- Parameters:
aggregations- Theaggregations. Must not be further mutated by the caller. Will not be mutated byAggregationProcessor.includeConstituents- Whether constituents should be included via a partition aggregation- Returns:
- The
AggregationContextFactory
-
forRollupReaggregated
public static AggregationContextFactory forRollupReaggregated(@NotNull @NotNull Collection<? extends Aggregation> aggregations, @NotNull @NotNull Collection<ColumnDefinition<?>> nullColumns, @NotNull @NotNull ColumnName rollupColumn) Convert a collection ofaggregationsto anAggregationContextFactoryfor use in computing a reaggregated level of a rollup.- Parameters:
aggregations- Theaggregations. Must not be further mutated by the caller. Will not be mutated byAggregationProcessor.nullColumns- Map of group-by column names and data types to aggregate with a null-column aggregationrollupColumn- the name of the rollup column in the result, used to traverse to the next lower level nodes- Returns:
- The
AggregationContextFactory
-
forRollupReaggregatedLeaf
public static AggregationContextFactory forRollupReaggregatedLeaf(@NotNull @NotNull Collection<? extends Aggregation> aggregations, @NotNull @NotNull Collection<ColumnDefinition<?>> nullColumns, @NotNull @NotNull ColumnName rollupColumn) Convert a collection ofaggregationsto anAggregationContextFactoryfor use in computing a reaggregated table, but without the ability to descend to the lower level (the rollupColumn is null).- Parameters:
aggregations- Theaggregations. Must not be further mutated by the caller. Will not be mutated byAggregationProcessor.nullColumns- Map of group-by column names and data types to aggregate with a null-column aggregationrollupColumn- the name of the rollup column in the result, which is always a null result- Returns:
- The
AggregationContextFactory
-
forTreeSourceRowLookup
Create a trivialAggregationContextFactoryto implement source-row lookup functionality fortree.- Returns:
- The
AggregationContextFactory
-
forSelectDistinct
Create a trivialAggregationContextFactoryto implementselect distinct.- Returns:
- The
AggregationContextFactory
-
forExposeGroupRowSets
Create a trivialAggregationContextFactorytogroupthe input table and expose the grouprow setsasEXPOSED_GROUP_ROW_SETS.- Returns:
- The
AggregationContextFactory
-
toString
-
makeAggregationContext
public AggregationContext makeAggregationContext(@NotNull @NotNull Table table, boolean requireStateChangeRecorder, @NotNull @NotNull String... groupByColumnNames) Description copied from interface:AggregationContextFactoryMake anAggregationContextfor this aggregation.- Specified by:
makeAggregationContextin interfaceAggregationContextFactory- Parameters:
table- The sourceTableto aggregaterequireStateChangeRecorder- Whether the resulting context is required to have an operator that extendsStateChangeRecordergroupByColumnNames- The key column names- Returns:
- A new or safely reusable
AggregationContext
-
getRowLookup
-