diff --git a/client/src/main/java/com/metamx/druid/client/DataSegment.java b/client/src/main/java/com/metamx/druid/client/DataSegment.java index 15cc8e672f5..1f7fcc42d19 100644 --- a/client/src/main/java/com/metamx/druid/client/DataSegment.java +++ b/client/src/main/java/com/metamx/druid/client/DataSegment.java @@ -194,6 +194,11 @@ public class DataSegment implements Comparable return builder(this).loadSpec(loadSpec).build(); } + public DataSegment withDimensions(List dimensions) + { + return builder(this).dimensions(dimensions).build(); + } + public DataSegment withSize(long size) { return builder(this).size(size).build(); diff --git a/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java b/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java index 9c5c5ee2ec0..5659758591b 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java @@ -307,16 +307,7 @@ public class RealtimePlumberSchool implements PlumberSchool DataSegment segment = segmentPusher.push( mergedFile, - new DataSegment( - schema.getDataSource(), - interval, - interval.getStart().toString(), - null, - Lists.newArrayList(index.getAvailableDimensions()), - Lists.newArrayList(index.getAvailableMetrics()), - new NoneShardSpec(), - 0 - ) + sink.getSegment().withDimensions(Lists.newArrayList(index.getAvailableDimensions())) ); metadataUpdater.publishSegment(segment); @@ -325,7 +316,6 @@ public class RealtimePlumberSchool implements PlumberSchool log.makeAlert(e, "Failed to persist merged index[%s]", schema.getDataSource()) .addData("interval", interval) .emit(); - return; } } }