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);
}
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);
}
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;
}
Aggregations