Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2784#discussion_r221258211
--- Diff:
core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/ColumnPageWrapper.java
---
@@ -302,8 +311,19 @@ public boolean isExplicitSorted() {
@Override
public int compareTo(int rowId, byte[] compareValue) {
- byte[] chunkData = this.getChunkData((int) rowId);
- return ByteUtil.UnsafeComparer.INSTANCE.compareTo(chunkData,
compareValue);
+ // rowId is the inverted index, but the null bitset is based on actual
data
+ int nullBitSetRowId = rowId;
+ if (isExplicitSorted()) {
+ nullBitSetRowId = getInvertedReverseIndex(rowId);
+ }
+ byte[] nullBitSet = getNullBitSet(nullBitSetRowId,
columnPage.getColumnSpec().getColumnType());
--- End diff --
why we need to handle inverted index for nullbitset, i think it is not
required
---