The query of one level of the drill-down, derived from the run's: after
the node it ran, a Filter of the expanded groups' keys (one rule each,
buildDrilldownKeyRule, joined by And), then at a group level a Group by
the levels down to this one, with each other column's aggregation
(CheckedDrilldown.aggregationOf) under a Group's own name and a Count
rows, then a Sort. At a group level the grid's sort on a group column is
kept, on another column becomes its aggregation's, and is left out on a
column with none; then the groups are sorted by the new level's column,
unless the grid already sorts by it, so a level cut at the row limit is
always the same. At the
leaf the grid's sort is kept as it is. A sort on a type that can't be
sorted is left out. Throws when a key can't be compared, or there are more
keys than levels.
The query of one level of the drill-down, derived from the run's: after the node it ran, a Filter of the expanded groups' keys (one rule each,
buildDrilldownKeyRule, joined by And), then at a group level a Group by the levels down to this one, with each other column's aggregation (CheckedDrilldown.aggregationOf) under a Group's own name and a Count rows, then a Sort. At a group level the grid's sort on a group column is kept, on another column becomes its aggregation's, and is left out on a column with none; then the groups are sorted by the new level's column, unless the grid already sorts by it, so a level cut at the row limit is always the same. At the leaf the grid's sort is kept as it is. A sort on a type that can't be sorted is left out. Throws when a key can't be compared, or there are more keys than levels.