From 6fc350bfbac649060546f1802cd5c2fc541411a9 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Wed, 16 Jan 2013 11:30:24 -0800 Subject: [PATCH] YeOldePlumberSchool: Populate dimension metadata in segment descriptor --- .../druid/merger/common/index/YeOldePlumberSchool.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/merger/src/main/java/com/metamx/druid/merger/common/index/YeOldePlumberSchool.java b/merger/src/main/java/com/metamx/druid/merger/common/index/YeOldePlumberSchool.java index a496f560970..77ce51ccb73 100644 --- a/merger/src/main/java/com/metamx/druid/merger/common/index/YeOldePlumberSchool.java +++ b/merger/src/main/java/com/metamx/druid/merger/common/index/YeOldePlumberSchool.java @@ -21,6 +21,7 @@ package com.metamx.druid.merger.common.index; import com.google.common.base.Preconditions; import com.google.common.base.Throwables; +import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -138,7 +139,13 @@ public class YeOldePlumberSchool implements PlumberSchool IndexMerger.mergeMMapped(indexes, schema.getAggregators(), fileToUpload); } - final DataSegment segmentToUpload = theSink.getSegment().withVersion(version); + // Map merged segment so we can extract dimensions + final MMappedIndex mappedSegment = IndexIO.mapDir(fileToUpload); + + final DataSegment segmentToUpload = theSink.getSegment() + .withDimensions(ImmutableList.copyOf(mappedSegment.getAvailableDimensions())) + .withVersion(version); + segmentPusher.push(fileToUpload, segmentToUpload); log.info(