From 2a7214089e10fb7e895825be2d531a8fd9e62424 Mon Sep 17 00:00:00 2001 From: xvrl Date: Tue, 18 Dec 2012 14:09:54 -0800 Subject: [PATCH] fix NPE in segmentMetadata query for null dimension values --- .../metamx/druid/query/metadata/SegmentMetadataQueryEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQueryEngine.java b/server/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQueryEngine.java index edc4ea3eda8..7522b4b4750 100644 --- a/server/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQueryEngine.java +++ b/server/src/main/java/com/metamx/druid/query/metadata/SegmentMetadataQueryEngine.java @@ -72,7 +72,7 @@ public class SegmentMetadataQueryEngine final Indexed lookup = adapter.getDimValueLookup(input); for (String dimVal : lookup) { ImmutableConciseSet index = adapter.getInvertedIndex(input, dimVal); - size += index.size() * Charsets.UTF_8.encode(dimVal).capacity(); + size += (dimVal == null) ? 0 : index.size() * Charsets.UTF_8.encode(dimVal).capacity(); } return new SegmentMetadataResultValue.Dimension( size,