Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2447#discussion_r200364300
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/dimension/v3/CompressedDimensionChunkFileBasedReaderV3.java
 ---
    @@ -289,4 +307,30 @@ private DimensionColumnPage 
decodeDimensionLegacy(DimensionRawColumnChunk rawCol
         }
         return columnDataChunk;
       }
    +
    +  private CarbonDictionary getDictionary(LocalDictionaryChunk 
localDictionaryChunk)
    +      throws IOException, MemoryException {
    +    if (null != localDictionaryChunk) {
    +      List<Encoding> encodings = 
localDictionaryChunk.getDictionary_meta().getEncoders();
    +      List<ByteBuffer> encoderMetas = 
localDictionaryChunk.getDictionary_meta().getEncoder_meta();
    +      ColumnPageDecoder decoder = encodingFactory.createDecoder(encodings, 
encoderMetas);
    +      ColumnPage decode = 
decoder.decode(localDictionaryChunk.getDictionary_data(), 0,
    +          localDictionaryChunk.getDictionary_data().length);
    +      BitSet usedDictionary = 
BitSet.valueOf(CompressorFactory.getInstance().getCompressor()
    +          .unCompressByte(localDictionaryChunk.getDictionary_values()));
    +      int length = usedDictionary.length();
    +      int index = 0;
    +      byte[][] dictionary = new byte[length][];
    +      for (int i = 0; i < length; i++) {
    +        if (usedDictionary.get(i)) {
    +          dictionary[i] = decode.getBytes(index++);
    +        } else {
    +          dictionary[i] = new byte[0];
    --- End diff --
    
    Assign null directly instead of o bytes


---

Reply via email to