Search in sources :

Example 1 with StarTreeIndexOperator

use of com.linkedin.pinot.core.operator.filter.StarTreeIndexOperator in project pinot by linkedin.

the class BaseHllStarTreeIndexTest method computeHllUsingAggregatedDocs.

/**
   * Helper method to compute the sum using aggregated docs.
   * @param metricNames
   * @param brokerRequest
   * @return
   */
private Map<String, long[]> computeHllUsingAggregatedDocs(IndexSegment segment, List<String> metricNames, BrokerRequest brokerRequest) throws Exception {
    StarTreeIndexOperator starTreeOperator = new StarTreeIndexOperator(segment, brokerRequest);
    starTreeOperator.open();
    BlockDocIdIterator starTreeDocIdIterator = starTreeOperator.nextBlock().getBlockDocIdSet().iterator();
    List<String> groupByColumns = Collections.EMPTY_LIST;
    if (brokerRequest.isSetAggregationsInfo() && brokerRequest.isSetGroupBy()) {
        groupByColumns = brokerRequest.getGroupBy().getColumns();
    }
    return computeHll(segment, starTreeDocIdIterator, metricNames, groupByColumns);
}
Also used : StarTreeIndexOperator(com.linkedin.pinot.core.operator.filter.StarTreeIndexOperator)

Example 2 with StarTreeIndexOperator

use of com.linkedin.pinot.core.operator.filter.StarTreeIndexOperator in project pinot by linkedin.

the class BaseSumStarTreeIndexTest method computeSumUsingAggregatedDocs.

/**
   * Helper method to compute the sum using aggregated docs.
   * @param metricNames
   * @param brokerRequest
   * @return
   */
private Map<String, double[]> computeSumUsingAggregatedDocs(IndexSegment segment, List<String> metricNames, BrokerRequest brokerRequest) {
    StarTreeIndexOperator starTreeOperator = new StarTreeIndexOperator(segment, brokerRequest);
    starTreeOperator.open();
    BlockDocIdIterator starTreeDocIdIterator = starTreeOperator.nextBlock().getBlockDocIdSet().iterator();
    List<String> groupByColumns = Collections.EMPTY_LIST;
    if (brokerRequest.isSetAggregationsInfo() && brokerRequest.isSetGroupBy()) {
        groupByColumns = brokerRequest.getGroupBy().getColumns();
    }
    return computeSum(segment, starTreeDocIdIterator, metricNames, groupByColumns);
}
Also used : StarTreeIndexOperator(com.linkedin.pinot.core.operator.filter.StarTreeIndexOperator) BlockDocIdIterator(com.linkedin.pinot.core.common.BlockDocIdIterator)

Example 3 with StarTreeIndexOperator

use of com.linkedin.pinot.core.operator.filter.StarTreeIndexOperator in project pinot by linkedin.

the class FilterPlanNode method run.

@Override
public Operator run() {
    long start = System.currentTimeMillis();
    Operator operator;
    FilterQueryTree filterQueryTree = RequestUtils.generateFilterQueryTree(_brokerRequest);
    if (_segment.getSegmentMetadata().hasStarTree() && RequestUtils.isFitForStarTreeIndex(_segment.getSegmentMetadata(), filterQueryTree, _brokerRequest)) {
        operator = new StarTreeIndexOperator(_segment, _brokerRequest);
    } else {
        operator = constructPhysicalOperator(filterQueryTree, _segment, _optimizeAlwaysFalse);
    }
    long end = System.currentTimeMillis();
    LOGGER.debug("FilterPlanNode.run took:{}", (end - start));
    return operator;
}
Also used : BaseFilterOperator(com.linkedin.pinot.core.operator.filter.BaseFilterOperator) BitmapBasedFilterOperator(com.linkedin.pinot.core.operator.filter.BitmapBasedFilterOperator) ScanBasedFilterOperator(com.linkedin.pinot.core.operator.filter.ScanBasedFilterOperator) MatchEntireSegmentOperator(com.linkedin.pinot.core.operator.filter.MatchEntireSegmentOperator) EmptyFilterOperator(com.linkedin.pinot.core.operator.filter.EmptyFilterOperator) SortedInvertedIndexBasedFilterOperator(com.linkedin.pinot.core.operator.filter.SortedInvertedIndexBasedFilterOperator) Operator(com.linkedin.pinot.core.common.Operator) FilterOperator(com.linkedin.pinot.common.request.FilterOperator) StarTreeIndexOperator(com.linkedin.pinot.core.operator.filter.StarTreeIndexOperator) AndOperator(com.linkedin.pinot.core.operator.filter.AndOperator) OrOperator(com.linkedin.pinot.core.operator.filter.OrOperator) FilterQueryTree(com.linkedin.pinot.common.utils.request.FilterQueryTree) StarTreeIndexOperator(com.linkedin.pinot.core.operator.filter.StarTreeIndexOperator)

Aggregations

StarTreeIndexOperator (com.linkedin.pinot.core.operator.filter.StarTreeIndexOperator)3 FilterOperator (com.linkedin.pinot.common.request.FilterOperator)1 FilterQueryTree (com.linkedin.pinot.common.utils.request.FilterQueryTree)1 BlockDocIdIterator (com.linkedin.pinot.core.common.BlockDocIdIterator)1 Operator (com.linkedin.pinot.core.common.Operator)1 AndOperator (com.linkedin.pinot.core.operator.filter.AndOperator)1 BaseFilterOperator (com.linkedin.pinot.core.operator.filter.BaseFilterOperator)1 BitmapBasedFilterOperator (com.linkedin.pinot.core.operator.filter.BitmapBasedFilterOperator)1 EmptyFilterOperator (com.linkedin.pinot.core.operator.filter.EmptyFilterOperator)1 MatchEntireSegmentOperator (com.linkedin.pinot.core.operator.filter.MatchEntireSegmentOperator)1 OrOperator (com.linkedin.pinot.core.operator.filter.OrOperator)1 ScanBasedFilterOperator (com.linkedin.pinot.core.operator.filter.ScanBasedFilterOperator)1 SortedInvertedIndexBasedFilterOperator (com.linkedin.pinot.core.operator.filter.SortedInvertedIndexBasedFilterOperator)1