Class RollupTableImpl

All Implemented Interfaces:
LogOutputAppendable, LivenessManager, LivenessNode, LivenessReferent, AttributeMap<RollupTable>, GridAttributes<RollupTable>, HierarchicalTable<RollupTable>, RollupTable, Serializable

public class RollupTableImpl extends HierarchicalTableImpl<RollupTable,RollupTableImpl> implements RollupTable
RollupTable implementation.
See Also:
  • Method Details

    • getAggregations

      public Collection<? extends Aggregation> getAggregations()
      Description copied from interface: RollupTable
      Get the aggregations for the rollup operation.
      Specified by:
      getAggregations in interface RollupTable
      Returns:
      The rollup aggregations
    • includesConstituents

      public boolean includesConstituents()
      Description copied from interface: RollupTable
      Are the source table's constituent rows included at the lowest level of the rollup?
      Specified by:
      includesConstituents in interface RollupTable
      Returns:
      Whether constituents are included
    • getGroupByColumns

      public Collection<? extends ColumnName> getGroupByColumns()
      Description copied from interface: RollupTable
      Get the group-by columns for the rollup operation.
      Specified by:
      getGroupByColumns in interface RollupTable
      Returns:
      The group-by columns
    • getDescription

      public String getDescription()
      Description copied from interface: HierarchicalTable
      Get a description of this HierarchicalTable.
      Specified by:
      getDescription in interface HierarchicalTable<RollupTable>
      Returns:
      The description
    • getEmptyExpansionsTable

      public Table getEmptyExpansionsTable()
      Description copied from interface: HierarchicalTable
      Get a re-usable, static key Table with zero rows that will cause a snapshot to expand only the default nodes.
      Specified by:
      getEmptyExpansionsTable in interface HierarchicalTable<RollupTable>
      Returns:
      An empty key Table for default expansions
    • getNodeDefinition

      public TableDefinition getNodeDefinition(@NotNull @NotNull RollupTable.NodeType nodeType)
      Description copied from interface: RollupTable
      Get the TableDefinition that should be exposed to node table consumers, e.g. UI-driven snapshots. This excludes "internal" columns used to organize the rollup or support operations, as well as the row-depth column and row-expanded column, but includes formatting columns.
      Specified by:
      getNodeDefinition in interface RollupTable
      Parameters:
      nodeType - The node type to get the TableDefinition for
      Returns:
      The externally-visible node TableDefinition for the requested nodeType
    • getAvailableColumnDefinitions

      public List<ColumnDefinition<?>> getAvailableColumnDefinitions()
      Description copied from interface: HierarchicalTable
      Get the definitions for all available columns that may be requested in a snapshot.

      The result will always begin with the structural columns, which are then followed by type-specific node-level columns.

      Specified by:
      getAvailableColumnDefinitions in interface HierarchicalTable<RollupTable>
      Returns:
      A list of definitions for all available columns that may be requested in a snapshot
    • withFilter

      public RollupTable withFilter(@NotNull @NotNull Filter filter)
      Description copied from interface: RollupTable
      Apply a filter to the source table for this RollupTable before applying the rollup operation. This filter must use only non-aggregate columns and must not use column arrays.
      Specified by:
      withFilter in interface RollupTable
      Parameters:
      filter - The filter to apply; must only reference non-aggregate columns and must not use column arrays
      Returns:
      The new RollupTable
    • withUpdateView

      public RollupTable withUpdateView(@NotNull @NotNull String... columns)
      Description copied from interface: RollupTable
      Apply a view to this RollupTable in order to produce a new RollupTable with additional columns at the aggregated node level.
      Specified by:
      withUpdateView in interface RollupTable
      Parameters:
      columns - The new columns to add
      Returns:
      The new RollupTable
    • withUpdateView

      public RollupTable withUpdateView(Collection<Selectable> columns)
      Description copied from interface: RollupTable
      Apply a view to this RollupTable in order to produce a new RollupTable with additional columns at the aggregated node level.
      Specified by:
      withUpdateView in interface RollupTable
      Parameters:
      columns - The new columns to add
      Returns:
      The new RollupTable
    • initializeAndValidateFilters

      public static WhereFilter[] initializeAndValidateFilters(@NotNull @NotNull Table source, @NotNull @NotNull Collection<? extends Aggregation> aggregations, @NotNull @NotNull Collection<? extends Filter> filters, @NotNull @NotNull Function<String,? extends RuntimeException> exceptionFactory)
      Initialize and validate the supplied filters for this RollupTable.
      Parameters:
      source - The rollup source
      aggregations - The rollup aggregations}
      filters - The filters to initialize and validate
      exceptionFactory - A factory for creating exceptions from their messages
      Returns:
      The initialized and validated filters
    • makeNodeOperationsRecorder

      public io.deephaven.engine.table.impl.hierarchical.RollupNodeOperationsRecorder makeNodeOperationsRecorder(@NotNull @NotNull RollupTable.NodeType nodeType)
      Description copied from interface: RollupTable
      Get a recorder for per-node operations to apply during snapshots of the requested RollupTable.NodeType.
      Specified by:
      makeNodeOperationsRecorder in interface RollupTable
      Parameters:
      nodeType - The node type that operations will be applied to
      Returns:
      The new recorder
    • withNodeOperations

      public RollupTable withNodeOperations(@NotNull @NotNull RollupTable.NodeOperationsRecorder... nodeOperations)
      Description copied from interface: RollupTable
      Get a new RollupTable that will apply the recorded operations to nodes when gathering snapshots. Operations will be applied only to the node type supplied when the elements of nodeOperations were initially created.
      Specified by:
      withNodeOperations in interface RollupTable
      Parameters:
      nodeOperations - The node-level operations to apply. Elements must have been initially supplied by RollupTable.makeNodeOperationsRecorder(NodeType) from this RollupTable.
      Returns:
      The new RollupTable
    • translateAggregatedNodeOperationsForConstituentNodes

      public RollupTable.NodeOperationsRecorder translateAggregatedNodeOperationsForConstituentNodes(@NotNull @NotNull RollupTable.NodeOperationsRecorder aggregatedNodeOperationsToTranslate)
      Description copied from interface: RollupTable
      Translate node operations for aggregated nodes to the closest equivalent for a constituent node. May only be invoked if includesConstituents() == true.
      Specified by:
      translateAggregatedNodeOperationsForConstituentNodes in interface RollupTable
      Parameters:
      aggregatedNodeOperationsToTranslate - Node-level operations for aggregated nodes, initially supplied by makeNodeOperationsRecorder(NodeType.Aggregated).
      Returns:
      Node-level operations for constituent nodes
    • copy

      protected RollupTableImpl copy()
      Description copied from class: LiveAttributeMap
      Create a copy of this with initially-shared LiveAttributeMap.mutableAttributes.
      Specified by:
      copy in class LiveAttributeMap<RollupTable,RollupTableImpl>
    • rebase

      public RollupTableImpl rebase(@NotNull @NotNull Table newSource)
      Description copied from interface: RollupTable
      Create a new RollupTable based on newSource, inheriting this RollupTable's aggregations, constituent inclusion, group-by columns, node operations, and filters.
      Specified by:
      rebase in interface RollupTable
      Parameters:
      newSource - A new source table that must have the same definition as the source of this rollup; that is newSource.getDefinition().equals(getSource().getDefinition()) must be true
      Returns:
      The new RollupTable
    • makeRollup

      public static RollupTable makeRollup(@NotNull @NotNull QueryTable source, @NotNull @NotNull Collection<? extends Aggregation> aggregations, boolean includeConstituents, @NotNull @NotNull Collection<? extends ColumnName> groupByColumns)
    • makeFromPartsInternal

      @InternalUseOnly public static RollupTable makeFromPartsInternal(@NotNull @NotNull QueryTable source, @NotNull @NotNull Map<String,Object> attributes, @NotNull @NotNull Collection<? extends Aggregation> aggregations, @NotNull @NotNull Collection<? extends ColumnName> groupByColumns, @NotNull @NotNull QueryTable[] levelTables, @NotNull @NotNull AggregationRowLookup[] levelRowLookups, @NotNull @NotNull ColumnSource<Table>[] levelNodeTableSources)

      Create a RollupTable from internal data structures that have been made outside the rollup code.

      Constituents may not be included, and node operations are not provided.

      Note: This function is not part of the public Deephaven API, and the semantics are subject to change at any time.

      Parameters:
      source - the original table being aggregated for this rollup
      attributes - the attributes of the result rollup
      aggregations - the aggregations used to make this rollup
      groupByColumns - the group by columns for this rollup
      levelTables - an array of tables for each level
      levelRowLookups - an array of row lookup structures for each level
      levelNodeTableSources - an array of column sources containing a lower-level table
      Returns:
      a RollupTable from the provided data structures