partitionedAggBy
partitionedAggBy
is a convenience method that performs an aggBy
operation on the source table and wraps the result in a PartitionedTable.
If the argument aggregations
does not include a partition, one will be added automatically with the default constituent column name __CONSTITUENT__
.
Syntax
partitionedAggBy(aggregations, preserveEmpty, initialGroups, keyColumnNames...)
Parameters
Parameter | Type | Description |
---|---|---|
aggregations | Collection<? extends Aggregation> | The aggregation(s) to apply to the source table. |
preserveEmpty | boolean | Whether to keep result rows for groups that are initially empty or become empty as a result of updates. Each aggregation operator defines its own value for empty groups. |
initialGroups | Table | A table whose distinct combinations of values for the |
keyColumnNames | String... | The names of the key columns to aggregate by. |
Returns
A PartitionedTable
.
Examples
In this example, partitionedAggBy
returns the source
table, as partitioned by StreetName
.
import static io.deephaven.api.agg.Aggregation.AggMed
source = newTable(
stringCol(
"HomeType",
"Colonial",
"Contemporary",
"Contemporary",
"Condo",
"Colonial",
"Apartment",
),
intCol("HouseNumber", 1, 3, 4, 15, 4, 9),
stringCol(
"StreetName",
"Test Drive",
"Community Circle",
"Test Drive",
"Deephaven Road",
"Community Circle",
"Deephaven Road",
),
intCol("SquareFeet", 2251, 1914, 4266, 1280, 3433, 981),
intCol("Price", 450000, 400000, 1250000, 300000, 600000, 275000),
)
result = source.partitionedAggBy([AggMed("Size = SquareFeet")], false, source, "StreetName")
- source