Github user manishgupta88 commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2654#discussion_r214341633 --- Diff: processing/src/main/java/org/apache/carbondata/processing/loading/partition/impl/RawRowComparator.java --- @@ -30,24 +33,39 @@ public class RawRowComparator implements Comparator<CarbonRow> { private int[] sortColumnIndices; private boolean[] isSortColumnNoDict; + private DataType[] noDicDataTypes; - public RawRowComparator(int[] sortColumnIndices, boolean[] isSortColumnNoDict) { + public RawRowComparator(int[] sortColumnIndices, boolean[] isSortColumnNoDict, + DataType[] noDicDataTypes) { this.sortColumnIndices = sortColumnIndices; this.isSortColumnNoDict = isSortColumnNoDict; + this.noDicDataTypes = noDicDataTypes; } @Override public int compare(CarbonRow o1, CarbonRow o2) { int diff = 0; int i = 0; + int noDicIdx = 0; for (int colIdx : sortColumnIndices) { if (isSortColumnNoDict[i]) { - byte[] colA = (byte[]) o1.getObject(colIdx); - byte[] colB = (byte[]) o2.getObject(colIdx); - diff = UnsafeComparer.INSTANCE.compareTo(colA, colB); - if (diff != 0) { - return diff; + if (DataTypeUtil.isPrimitiveColumn(noDicDataTypes[noDicIdx])) { + // for no dictionary numeric column get comparator based on the data type + SerializableComparator comparator = org.apache.carbondata.core.util.comparator.Comparator --- End diff -- increment `noDicIdx` in if block and remove from method end
---