diff --git a/tsfile/src/main/java/org/apache/tsfile/encoding/encoder/DictionaryEncoder.java b/tsfile/src/main/java/org/apache/tsfile/encoding/encoder/DictionaryEncoder.java index df9e10464..4a6fde552 100644 --- a/tsfile/src/main/java/org/apache/tsfile/encoding/encoder/DictionaryEncoder.java +++ b/tsfile/src/main/java/org/apache/tsfile/encoding/encoder/DictionaryEncoder.java @@ -61,14 +61,15 @@ public DictionaryEncoder() { @Override public void encode(Binary value, ByteArrayOutputStream out) { - entryIndex.computeIfAbsent( - value, - v -> { - indexEntry.add(v); - mapSize += v.getLength(); - return entryIndex.size(); - }); - valuesEncoder.encode(entryIndex.get(value), out); + int i = + entryIndex.computeIfAbsent( + value, + v -> { + indexEntry.add(v); + mapSize += v.getLength(); + return entryIndex.size(); + }); + valuesEncoder.encode(i, out); } @Override