Merge pull request #1400 from metamx/groupByCheckForNullDimSpec

Add checkin GroupByQuery for null DimensionSpec in dimension list
This commit is contained in:
Fangjin Yang 2015-05-28 15:48:30 -07:00
commit 13c402d5d6
1 changed files with 3 additions and 0 deletions

View File

@ -90,6 +90,9 @@ public class GroupByQuery extends BaseQuery<Row>
this.dimFilter = dimFilter;
this.granularity = granularity;
this.dimensions = dimensions == null ? ImmutableList.<DimensionSpec>of() : dimensions;
for (DimensionSpec spec : this.dimensions) {
Preconditions.checkArgument(spec != null, "dimensions has null DimensionSpec");
}
this.aggregatorSpecs = aggregatorSpecs;
this.postAggregatorSpecs = postAggregatorSpecs == null ? ImmutableList.<PostAggregator>of() : postAggregatorSpecs;
this.havingSpec = havingSpec;