Class GroupByRowProcessor
java.lang.Object
org.apache.druid.query.groupby.epinephelinae.GroupByRowProcessor
Utility class that knows how to do higher-level groupBys: i.e. group a
Sequence of ResultRow
originating from a subquery. It uses a buffer provided by a GroupByQueryResources. The output rows may not
be perfectly grouped and will not have PostAggregators applied, so they should be fed into
GroupingEngine.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 GroupByMergingQueryRunner, but is different enough that it deserved to
be its own class. Some common code between the two classes is in RowBasedGrouperHelper.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionprocess(GroupByQuery query, GroupByQuery subquery, Sequence<ResultRow> rows, GroupByQueryConfig config, DruidProcessingConfig processingConfig, GroupByQueryResources resource, com.fasterxml.jackson.databind.ObjectMapper spillMapper, String processingTmpDir, int mergeBufferSize, GroupByStatsProvider.PerQueryStats perQueryStats) Process the input of sequence "rows" (output by "subquery") based on "query" and returns aGroupByRowProcessor.ResultSupplier.
-
Method Details
-
process
public static GroupByRowProcessor.ResultSupplier process(GroupByQuery query, GroupByQuery subquery, Sequence<ResultRow> rows, GroupByQueryConfig config, DruidProcessingConfig processingConfig, GroupByQueryResources resource, com.fasterxml.jackson.databind.ObjectMapper spillMapper, String processingTmpDir, int mergeBufferSize, GroupByStatsProvider.PerQueryStats perQueryStats) Process the input of sequence "rows" (output by "subquery") based on "query" and returns aGroupByRowProcessor.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 theGroupByRowProcessor.ResultSupplier. Make sure to close it when you're done.
-