use of com.linkedin.pinot.common.request.FilterQuery in project pinot by linkedin.
the class QueryExecutorTest method getSumQuery.
private BrokerRequest getSumQuery() {
BrokerRequest query = new BrokerRequest();
AggregationInfo aggregationInfo = getSumAggregationInfo();
List<AggregationInfo> aggregationsInfo = new ArrayList<AggregationInfo>();
aggregationsInfo.add(aggregationInfo);
query.setAggregationsInfo(aggregationsInfo);
FilterQuery filterQuery = getFilterQuery();
query.setFilterQuery(filterQuery);
return query;
}
use of com.linkedin.pinot.common.request.FilterQuery in project pinot by linkedin.
the class QueryExecutorTest method getMaxQuery.
private BrokerRequest getMaxQuery() {
BrokerRequest query = new BrokerRequest();
AggregationInfo aggregationInfo = getMaxAggregationInfo();
List<AggregationInfo> aggregationsInfo = new ArrayList<AggregationInfo>();
aggregationsInfo.add(aggregationInfo);
query.setAggregationsInfo(aggregationsInfo);
FilterQuery filterQuery = getFilterQuery();
query.setFilterQuery(filterQuery);
return query;
}
use of com.linkedin.pinot.common.request.FilterQuery in project pinot by linkedin.
the class BrokerRequestOptimizer method optimizeFilterQueryTree.
/**
* Optimizes the filter query tree of a broker request in place.
* @param brokerRequest The broker request to optimize
* @param timeColumn time column
*/
private void optimizeFilterQueryTree(BrokerRequest brokerRequest, String timeColumn, OptimizationFlags optimizationFlags) {
FilterQueryTree filterQueryTree = null;
FilterQuery q = brokerRequest.getFilterQuery();
if (q == null || brokerRequest.getFilterSubQueryMap() == null) {
return;
}
filterQueryTree = RequestUtils.buildFilterQuery(q.getId(), brokerRequest.getFilterSubQueryMap().getFilterQueryMap());
FilterQueryOptimizerRequest.FilterQueryOptimizerRequestBuilder builder = new FilterQueryOptimizerRequest.FilterQueryOptimizerRequestBuilder();
FilterQueryOptimizerRequest request = builder.setFilterQueryTree(filterQueryTree).setTimeColumn(timeColumn).build();
if (optimizationFlags == null) {
for (FilterQueryTreeOptimizer filterQueryTreeOptimizer : FILTER_QUERY_TREE_OPTIMIZERS) {
filterQueryTree = filterQueryTreeOptimizer.optimize(request);
// Optimizers may return a new tree instead of in-place optimization
request.setFilterQueryTree(filterQueryTree);
}
} else {
if (optimizationFlags.isOptimizationEnabled("filterQueryTree")) {
for (FilterQueryTreeOptimizer filterQueryTreeOptimizer : FILTER_QUERY_TREE_OPTIMIZERS) {
if (optimizationFlags.isOptimizationEnabled(filterQueryTreeOptimizer.getOptimizationName())) {
filterQueryTree = filterQueryTreeOptimizer.optimize(request);
// Optimizers may return a new tree instead of in-place optimization
request.setFilterQueryTree(filterQueryTree);
}
}
}
}
RequestUtils.generateFilterFromTree(filterQueryTree, brokerRequest);
}
use of com.linkedin.pinot.common.request.FilterQuery in project pinot by linkedin.
the class InstanceServerStarter method getMaxQuery.
private static BrokerRequest getMaxQuery() {
BrokerRequest query = new BrokerRequest();
AggregationInfo aggregationInfo = getMaxAggregationInfo();
List<AggregationInfo> aggregationsInfo = new ArrayList<AggregationInfo>();
aggregationsInfo.add(aggregationInfo);
query.setAggregationsInfo(aggregationsInfo);
FilterQuery filterQuery = getFilterQuery();
query.setFilterQuery(filterQuery);
return query;
}
use of com.linkedin.pinot.common.request.FilterQuery in project pinot by linkedin.
the class InstanceServerStarter method getMinQuery.
private static BrokerRequest getMinQuery() {
BrokerRequest query = new BrokerRequest();
AggregationInfo aggregationInfo = getMinAggregationInfo();
List<AggregationInfo> aggregationsInfo = new ArrayList<AggregationInfo>();
aggregationsInfo.add(aggregationInfo);
query.setAggregationsInfo(aggregationsInfo);
FilterQuery filterQuery = getFilterQuery();
query.setFilterQuery(filterQuery);
return query;
}
Aggregations