Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2417#discussion_r198868873
--- Diff:
core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/ColumnPageWrapper.java
---
@@ -77,14 +134,115 @@ public boolean isExplicitSorted() {
return false;
}
- @Override
- public int compareTo(int rowId, byte[] compareValue) {
- throw new UnsupportedOperationException("internal error");
+ @Override public int compareTo(int rowId, byte[] compareValue) {
+ if (columnPage.getColumnSpec().getColumnType() ==
ColumnType.DIRECT_DICTIONARY) {
+ int surrogate = columnPage.getInt(rowId);
+ int input = ByteBuffer.wrap(compareValue).getInt();
+ return surrogate - input;
+ } else {
+ byte[] data;
+ if (columnPage.getDataType() == DataTypes.INT) {
--- End diff --
First convert `compareValue` to respective datatype and compare with actual
value
---