diff --git a/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java b/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java index 6f996ea0da3..e88868673d6 100644 --- a/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java +++ b/processing/src/main/java/io/druid/query/filter/ExtractionDimFilter.java @@ -82,7 +82,7 @@ public class ExtractionDimFilter implements DimFilter public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); - byte[] valueBytes = StringUtils.toUtf8(value); + byte[] valueBytes = value == null ? new byte[0] : StringUtils.toUtf8(value); byte[] extractionFnBytes = extractionFn.getCacheKey(); return ByteBuffer.allocate(3 + dimensionBytes.length + valueBytes.length + extractionFnBytes.length) .put(DimFilterCacheHelper.EXTRACTION_CACHE_ID) diff --git a/processing/src/test/java/io/druid/query/filter/ExtractionDimFilterTest.java b/processing/src/test/java/io/druid/query/filter/ExtractionDimFilterTest.java index 83bd406495d..03b26b24c4d 100644 --- a/processing/src/test/java/io/druid/query/filter/ExtractionDimFilterTest.java +++ b/processing/src/test/java/io/druid/query/filter/ExtractionDimFilterTest.java @@ -55,5 +55,7 @@ public class ExtractionDimFilterTest ); Assert.assertFalse(Arrays.equals(extractionDimFilter2.getCacheKey(), extractionDimFilter3.getCacheKey())); + + Assert.assertNotNull(new ExtractionDimFilter("foo", null, new RegexDimExtractionFn("xx", null, null), null)); } }