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
FieldsModifier and TypeFieldDescriptionstatic final ColumnNamestatic final ColumnNameThe name of the column we inject into AggFormula to permit the user to vary the formula based on which level of the rollup is being evaluated.static final ColumnName -
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, @NotNull Table source) 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
-
ROLLUP_FORMULA_DEPTH
The name of the column we inject into AggFormula to permit the user to vary the formula based on which level of the rollup is being evaluated. -
ROLLUP_FORMULA_KEYS
-
-
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, @NotNull @NotNull Table source) 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 nodessource- the original source table of the rollup (not the table we are reaggregating)- 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
-