rollup

The Deephaven rollup method creates a rollup table from a source table with zero or more aggregations and zero or more grouping columns to create a hierarchy.

Syntax

Parameters

ParameterTypeDescription
aggslist[Aggregation]

A list of aggregations. If None, no aggregations are performed.

The following aggregations are supported:

bylist[str]

Zero or more column names to group on and create a hierarchy from. If None, no hierarchy is created.

include_constituents optionalbool

Whether or not to include constituent rows at the leaf level. Default is False.

Methods

Instance

  • with_filters(filters...) - Create a new rollup table that applies a set of filters to the groupByColumns of the rollup table.
  • with_update_view(columns...) - Create a new rollup table that applies a set of update_view operations to the groupByColumns of the rollup table.
  • node_operation_recorder(nodeType) - Get a recorder for per-node operations to apply during snapshots of the requested NodeType.
  • with_node_operations(recorders...) - Create a new rollup table that applies the recorded operations to nodes when gathering snapshots.

Returns

A rollup table.

Examples

The following example creates two rollup tables from a source table of insurance expense data. The first performs no aggregations, but creates a hierarchy from the region and age columns. The second performs two aggregations: the aggregated average of the bmi and expenses columns are calculated, then the same by columns are given as the first. The optional argument include_constituents is set to True so that members of the lowest-level nodes (individual cells) can be expanded.

Similar to the previous example, this example creates a rollup table from a source table of insurance expense data. However, this time we are filtering on the source table before applying the rollup using with_filters. Both group and constituent columns can be used in the filter, while aggregation columns cannot.

The following example creates a rollup table from real-time source data. The source data updates 10,000 times per second. The result rollup table can be expanded by the N column to show unique values of M for each N. The aggregated average and sum are calculated for the Value and Weight, respectively.

The above result rollup table