Search in sources :

Example 1 with FilterPlanNode

use of com.linkedin.pinot.core.plan.FilterPlanNode in project pinot by linkedin.

the class BaseSumStarTreeIndexTest method computeSumUsingRawDocs.

/**
   * Helper method to compute the sums using raw index.
   *  @param metricNames
   * @param brokerRequest
   */
private Map<String, double[]> computeSumUsingRawDocs(IndexSegment segment, List<String> metricNames, BrokerRequest brokerRequest) {
    FilterPlanNode planNode = new FilterPlanNode(segment, brokerRequest);
    Operator rawOperator = planNode.run();
    BlockDocIdIterator rawDocIdIterator = rawOperator.nextBlock().getBlockDocIdSet().iterator();
    List<String> groupByColumns = Collections.EMPTY_LIST;
    if (brokerRequest.isSetAggregationsInfo() && brokerRequest.isSetGroupBy()) {
        groupByColumns = brokerRequest.getGroupBy().getColumns();
    }
    return computeSum(segment, rawDocIdIterator, metricNames, groupByColumns);
}
Also used : StarTreeIndexOperator(com.linkedin.pinot.core.operator.filter.StarTreeIndexOperator) Operator(com.linkedin.pinot.core.common.Operator) FilterPlanNode(com.linkedin.pinot.core.plan.FilterPlanNode) BlockDocIdIterator(com.linkedin.pinot.core.common.BlockDocIdIterator)

Example 2 with FilterPlanNode

use of com.linkedin.pinot.core.plan.FilterPlanNode in project pinot by linkedin.

the class BaseHllStarTreeIndexTest method computeHllUsingRawDocs.

/**
   * Helper method to compute the sums using raw index.
   *  @param metricNames
   * @param brokerRequest
   */
private Map<String, long[]> computeHllUsingRawDocs(IndexSegment segment, List<String> metricNames, BrokerRequest brokerRequest) throws Exception {
    FilterPlanNode planNode = new FilterPlanNode(segment, brokerRequest);
    Operator rawOperator = planNode.run();
    BlockDocIdIterator rawDocIdIterator = rawOperator.nextBlock().getBlockDocIdSet().iterator();
    List<String> groupByColumns = Collections.EMPTY_LIST;
    if (brokerRequest.isSetAggregationsInfo() && brokerRequest.isSetGroupBy()) {
        groupByColumns = brokerRequest.getGroupBy().getColumns();
    }
    return computeHll(segment, rawDocIdIterator, metricNames, groupByColumns);
}
Also used : StarTreeIndexOperator(com.linkedin.pinot.core.operator.filter.StarTreeIndexOperator) FilterPlanNode(com.linkedin.pinot.core.plan.FilterPlanNode)

Aggregations

StarTreeIndexOperator (com.linkedin.pinot.core.operator.filter.StarTreeIndexOperator)2 FilterPlanNode (com.linkedin.pinot.core.plan.FilterPlanNode)2 BlockDocIdIterator (com.linkedin.pinot.core.common.BlockDocIdIterator)1 Operator (com.linkedin.pinot.core.common.Operator)1