From 6e550d5346bcf3f2fdcf2facc79a854130209710 Mon Sep 17 00:00:00 2001 From: Himanshu Gupta Date: Thu, 24 Sep 2015 22:25:07 -0500 Subject: [PATCH] update doc about aggregation field in merge task and a null check --- docs/content/misc/tasks.md | 1 + .../src/main/java/io/druid/indexing/common/task/MergeTask.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/content/misc/tasks.md b/docs/content/misc/tasks.md index beaa2ba6d36..8c116e248f2 100644 --- a/docs/content/misc/tasks.md +++ b/docs/content/misc/tasks.md @@ -294,6 +294,7 @@ Merge tasks merge a list of segments together. Any common timestamps are merged. "type": "merge", "id": , "dataSource": , + "aggregations": , "segments": } ``` diff --git a/indexing-service/src/main/java/io/druid/indexing/common/task/MergeTask.java b/indexing-service/src/main/java/io/druid/indexing/common/task/MergeTask.java index 543accff499..ebf86904d06 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/task/MergeTask.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/task/MergeTask.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; +import com.google.common.base.Preconditions; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -56,7 +57,7 @@ public class MergeTask extends MergeTaskBase ) { super(id, dataSource, segments, context); - this.aggregators = aggregators; + this.aggregators = Preconditions.checkNotNull(aggregators, "null aggregations"); this.indexSpec = indexSpec == null ? new IndexSpec() : indexSpec; }