From 377982adc01b6fda7584c2652607fcc90ec72e53 Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Sat, 25 May 2024 11:56:48 -0700 Subject: [PATCH] fix: `ColumnReader.loadVector` should initiate `CometDictionary` after re-import arrays --- .../org/apache/comet/parquet/ColumnReader.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/org/apache/comet/parquet/ColumnReader.java b/common/src/main/java/org/apache/comet/parquet/ColumnReader.java index 46fd87f6b8..cbba6946e4 100644 --- a/common/src/main/java/org/apache/comet/parquet/ColumnReader.java +++ b/common/src/main/java/org/apache/comet/parquet/ColumnReader.java @@ -230,15 +230,15 @@ public CometDecodedVector loadVector() { // return plain vector. currentVector = cometVector; return currentVector; - } else if (dictionary == null) { - // There is dictionary from native side but the Java side dictionary hasn't been - // initialized yet. - Dictionary arrowDictionary = dictionaryProvider.lookup(dictionaryEncoding.getId()); - CometPlainVector dictionaryVector = - new CometPlainVector(arrowDictionary.getVector(), useDecimal128, isUuid); - dictionary = new CometDictionary(dictionaryVector); } + // There is dictionary from native side but the Java side dictionary hasn't been + // initialized yet. + Dictionary arrowDictionary = dictionaryProvider.lookup(dictionaryEncoding.getId()); + CometPlainVector dictionaryVector = + new CometPlainVector(arrowDictionary.getVector(), useDecimal128, isUuid); + dictionary = new CometDictionary(dictionaryVector); + currentVector = new CometDictionaryVector( cometVector, dictionary, dictionaryProvider, useDecimal128, false, isUuid);