From 4eee7e69b9c6fd7b362531a2ae71c8de0177958f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Wed, 26 Nov 2014 15:00:02 -0800 Subject: [PATCH] fix cardinality aggregator caching --- .../aggregation/cardinality/CardinalityAggregatorFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/processing/src/main/java/io/druid/query/aggregation/cardinality/CardinalityAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/cardinality/CardinalityAggregatorFactory.java index 071a91b3c3e..368ebbc6f2d 100644 --- a/processing/src/main/java/io/druid/query/aggregation/cardinality/CardinalityAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/cardinality/CardinalityAggregatorFactory.java @@ -214,9 +214,10 @@ public class CardinalityAggregatorFactory implements AggregatorFactory { byte[] fieldNameBytes = Joiner.on("\u0001").join(fieldNames).getBytes(Charsets.UTF_8); - return ByteBuffer.allocate(1 + fieldNameBytes.length) + return ByteBuffer.allocate(2 + fieldNameBytes.length) .put(CACHE_TYPE_ID) .put(fieldNameBytes) + .put((byte)(byRow ? 1 : 0)) .array(); }