Class QuerySemantics
The parsed query already records which selections are aggregated and whether it groups, so a consumer never has to infer either from the values that come back. A pivot that knows a column is an average will refuse to average it again; one that has to guess will guess wrong on exactly the data where it matters.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AggregateFnaggregateFn(String fn) The aggregate a query function name stands for, or null for a scalar function or none.static Map<String, AggregateFn> aggregatesByColumn(Query query) The aggregation method behind each result column, for the columns that have one.static AggregationLevelWhether the query returns rows or grouped measures.
-
Method Details
-
aggregatesByColumn
The aggregation method behind each result column, for the columns that have one. -
levelOf
Whether the query returns rows or grouped measures.A query is aggregate if it groups or if any selection aggregates. A query that mixes grouped and ungrouped selections is aggregate too: once any row-combining has happened, no record in the result corresponds to a single underlying row, which is the only thing
detailpromises. Where the two readings differ, this errs towardaggregate, because a consumer that wrongly believes it holds detail rows will re-aggregate them and double-count, while one that wrongly believes it holds measures will decline to and say so. -
aggregateFn
The aggregate a query function name stands for, or null for a scalar function or none.
-