Search in sources :

Example 1 with GroupMaker

use of org.apache.cassandra.db.aggregation.GroupMaker in project cassandra by apache.

the class SelectStatement method process.

private ResultSet process(PartitionIterator partitions, QueryOptions options, Selectors selectors, int nowInSec, int userLimit) throws InvalidRequestException {
    GroupMaker groupMaker = aggregationSpec == null ? null : aggregationSpec.newGroupMaker();
    ResultSetBuilder result = new ResultSetBuilder(getResultMetadata(), selectors, groupMaker);
    while (partitions.hasNext()) {
        try (RowIterator partition = partitions.next()) {
            processPartition(partition, options, result, nowInSec);
        }
    }
    ResultSet cqlRows = result.build();
    maybeWarn(result, options);
    orderResults(cqlRows);
    cqlRows.trim(userLimit);
    return cqlRows;
}
Also used : ResultSetBuilder(org.apache.cassandra.cql3.selection.ResultSetBuilder) RowIterator(org.apache.cassandra.db.rows.RowIterator) GroupMaker(org.apache.cassandra.db.aggregation.GroupMaker)

Aggregations

ResultSetBuilder (org.apache.cassandra.cql3.selection.ResultSetBuilder)1 GroupMaker (org.apache.cassandra.db.aggregation.GroupMaker)1 RowIterator (org.apache.cassandra.db.rows.RowIterator)1