diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/hadoop/DatasourceIngestionSpec.java b/indexing-hadoop/src/main/java/io/druid/indexer/hadoop/DatasourceIngestionSpec.java index 4bff88c3e79..8c27cf07f74 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/hadoop/DatasourceIngestionSpec.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/hadoop/DatasourceIngestionSpec.java @@ -102,6 +102,11 @@ public class DatasourceIngestionSpec return new DatasourceIngestionSpec(dataSource, interval, filter, granularity, dimensions, metrics); } + public DatasourceIngestionSpec withQueryGranularity(QueryGranularity granularity) + { + return new DatasourceIngestionSpec(dataSource, interval, filter, granularity, dimensions, metrics); + } + @Override public boolean equals(Object o) { diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/path/DatasourcePathSpec.java b/indexing-hadoop/src/main/java/io/druid/indexer/path/DatasourcePathSpec.java index 42acf9e9bb4..2f2c9018018 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/path/DatasourcePathSpec.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/path/DatasourcePathSpec.java @@ -147,6 +147,8 @@ public class DatasourcePathSpec implements PathSpec updatedIngestionSpec = updatedIngestionSpec.withMetrics(Lists.newArrayList(metrics)); } + updatedIngestionSpec = updatedIngestionSpec.withQueryGranularity(config.getGranularitySpec().getQueryGranularity()); + job.getConfiguration().set(DatasourceInputFormat.CONF_DRUID_SCHEMA, mapper.writeValueAsString(updatedIngestionSpec)); job.getConfiguration().set(DatasourceInputFormat.CONF_INPUT_SEGMENTS, mapper.writeValueAsString(segments)); job.getConfiguration().set(DatasourceInputFormat.CONF_MAX_SPLIT_SIZE, String.valueOf(maxSplitSize));