Github user kevinjmh commented on the issue:

    https://github.com/apache/carbondata/pull/2886
  
    @akashrn5 thanks for reply. 
    
    1. Let's take a detail case. you can check whether it is right.
     
     In `DictDimensionIndexCodec#createEncoder`, as the setting I said above
     `isSort`=false
     `isDoInvertedIndex` = true
     `isInvertedIndex`=`isSort`&&`isDoInvertedIndex` = false
    so, it will go to `indexStorage = new 
BlockIndexerStorageForNoInvertedIndexForShort(data, false);`.
    In the construction method, we can see that it only assigns the dataPage 
value. No RLE.
    ```
      public BlockIndexerStorageForNoInvertedIndexForShort(byte[][] dataPage, 
boolean applyRLE) {
        this.dataPage = dataPage;
        if (applyRLE) {
          List<byte[]> actualDataList = new ArrayList<>();
          for (int i = 0; i < dataPage.length; i++) {
            actualDataList.add(dataPage[i]);
          }
          rleEncodeOnData(actualDataList);
        }
      }
    ```
    
    2. If isInvertedIndex is TRUE, then the isSort check must be TRUE
    
    ```
    isInvertedIndex    =      isSort    &&        isDoInvertedIndex;
           ^                     ^                       ^
           |                     |                       |
    internalUsed          SORT_COLUMNS           INVERTED_INDEX
    
    ```
    
    



---

Reply via email to