use of com.linkedin.pinot.common.request.AggregationInfo in project pinot by linkedin.
the class SegmentQueryProcessor method pruneSegment.
private boolean pruneSegment(BrokerRequest brokerRequest) {
// Check if segment belongs to the table being queried.
if (!_tableName.equals(brokerRequest.getQuerySource().getTableName())) {
LOGGER.debug("Skipping segment {} from different table {}", _segmentName, _tableName);
return true;
}
// Check if any column in the query does not exist in the segment.
Set<String> allColumns = _metadata.getAllColumns();
if (brokerRequest.isSetAggregationsInfo()) {
for (AggregationInfo aggregationInfo : brokerRequest.getAggregationsInfo()) {
Map<String, String> aggregationParams = aggregationInfo.getAggregationParams();
for (String column : aggregationParams.values()) {
if (column != null && !column.isEmpty() && !column.equals("*") && !allColumns.contains(column)) {
LOGGER.debug("Skipping segment '{}', as it does not have column '{}'", _metadata.getName(), column);
return true;
}
}
GroupBy groupBy = brokerRequest.getGroupBy();
if (groupBy != null) {
for (String column : groupBy.getColumns()) {
if (!allColumns.contains(column)) {
LOGGER.debug("Skipping segment '{}', as it does not have column '{}'", _metadata.getName(), column);
return true;
}
}
}
}
} else {
if (brokerRequest.isSetSelections()) {
for (String column : brokerRequest.getSelections().getSelectionColumns()) {
if (!allColumns.contains(column)) {
LOGGER.debug("Skipping segment '{}', as it does not have column '{}'", _metadata.getName(), column);
return true;
}
}
}
}
return false;
}
use of com.linkedin.pinot.common.request.AggregationInfo in project pinot by linkedin.
the class BrokerReduceServiceTest method getCountQuery.
private BrokerRequest getCountQuery() {
BrokerRequest query = new BrokerRequest();
AggregationInfo aggregationInfo = getCountAggregationInfo();
List<AggregationInfo> aggregationsInfo = new ArrayList<AggregationInfo>();
aggregationsInfo.add(aggregationInfo);
query.setAggregationsInfo(aggregationsInfo);
query.setFilterQuery(null);
return query;
}
use of com.linkedin.pinot.common.request.AggregationInfo in project pinot by linkedin.
the class BrokerReduceServiceTest method getAvgQuery.
private BrokerRequest getAvgQuery() {
BrokerRequest query = new BrokerRequest();
AggregationInfo aggregationInfo = getAvgAggregationInfo();
List<AggregationInfo> aggregationsInfo = new ArrayList<AggregationInfo>();
aggregationsInfo.add(aggregationInfo);
query.setAggregationsInfo(aggregationsInfo);
query.setFilterQuery(null);
return query;
}
use of com.linkedin.pinot.common.request.AggregationInfo in project pinot by linkedin.
the class BrokerReduceServiceTest method getAvgAggregationInfo.
private AggregationInfo getAvgAggregationInfo() {
String type = "avg";
Map<String, String> params = new HashMap<String, String>();
params.put("column", "met");
AggregationInfo aggregationInfo = new AggregationInfo();
aggregationInfo.setAggregationType(type);
aggregationInfo.setAggregationParams(params);
return aggregationInfo;
}
use of com.linkedin.pinot.common.request.AggregationInfo in project pinot by linkedin.
the class BrokerReduceServiceTest method getMaxQuery.
private BrokerRequest getMaxQuery() {
BrokerRequest query = new BrokerRequest();
AggregationInfo aggregationInfo = getMaxAggregationInfo();
List<AggregationInfo> aggregationsInfo = new ArrayList<AggregationInfo>();
aggregationsInfo.add(aggregationInfo);
query.setAggregationsInfo(aggregationsInfo);
query.setFilterQuery(null);
return query;
}
Aggregations