public class GroupByRowProcessor extends Object
Sequence of ResultRow
originating from a subquery. It uses a buffer provided by a GroupByQueryResource. The output rows may not
be perfectly grouped and will not have PostAggregators applied, so they should be fed into
GroupByStrategy.mergeResults(org.apache.druid.query.QueryRunner<org.apache.druid.query.groupby.ResultRow>, org.apache.druid.query.groupby.GroupByQuery, org.apache.druid.query.context.ResponseContext).
This class has two primary uses: processing nested groupBys, and processing subtotals.
This class has some similarity to GroupByMergingQueryRunnerV2, but is different enough that it deserved to
be its own class. Some common code between the two classes is in RowBasedGrouperHelper.| Modifier and Type | Class and Description |
|---|---|
static interface |
GroupByRowProcessor.ResultSupplier |
| Modifier and Type | Method and Description |
|---|---|
static GroupByRowProcessor.ResultSupplier |
process(GroupByQuery query,
GroupByQuery subquery,
Sequence<ResultRow> rows,
GroupByQueryConfig config,
GroupByQueryResource resource,
com.fasterxml.jackson.databind.ObjectMapper spillMapper,
String processingTmpDir,
int mergeBufferSize)
Process the input of sequence "rows" (output by "subquery") based on "query" and returns a
GroupByRowProcessor.ResultSupplier. |
public static GroupByRowProcessor.ResultSupplier process(GroupByQuery query, GroupByQuery subquery, Sequence<ResultRow> rows, GroupByQueryConfig config, GroupByQueryResource resource, com.fasterxml.jackson.databind.ObjectMapper spillMapper, String processingTmpDir, int mergeBufferSize)
GroupByRowProcessor.ResultSupplier.
In addition to grouping using dimensions and metrics, it will also apply filters (both DimFilter and interval
filters).
The input sequence is processed synchronously with the call to this method, and result iteration happens lazy upon
calls to the GroupByRowProcessor.ResultSupplier. Make sure to close it when you're done.Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.