timoninmaxim commented on code in PR #10080:
URL: https://github.com/apache/ignite/pull/10080#discussion_r915958357


##########
modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/QueryIndexRowHandler.java:
##########
@@ -98,68 +108,45 @@ public List<IndexColumn> getH2IdxColumns() {
 
     /** */
     private Object getKey(int idx, CacheDataRow row) {
-        int cacheIdx = h2IdxColumns.get(idx).column.getColumnId();
+        int colId = keyColumns.get(idx);
 
-        if (cacheDesc.isKeyColumn(cacheIdx))
-            return key(row);
+        if (rowDescriptor.isKeyColumn(colId))
+            return unwrap(row.key());
 
-        else if (cacheDesc.isValueColumn(cacheIdx))
-            return value(row);
+        else if (rowDescriptor.isValueColumn(colId))
+            return unwrap(row.value());
 
-        // columnValue ignores default columns (_KEY, _VAL), so make this 
shift.
-        return cacheDesc.columnValue(row.key(), row.value(), cacheIdx - 
QueryUtils.DEFAULT_COLUMNS_COUNT);
+        // getFieldValue ignores default columns (_KEY, _VAL), so make this 
shift.
+        return rowDescriptor.getFieldValue(row.key(), row.value(), colId - 
QueryUtils.DEFAULT_COLUMNS_COUNT);
     }
 
     /** {@inheritDoc} */
     @Override public int partition(CacheDataRow row) {
-        Object key = key(row);
+        Object key = unwrap(row.key());
 
-        return cacheDesc.context().affinity().partition(key);
+        return rowDescriptor.context().affinity().partition(key);

Review Comment:
   We can use `KeyCacheObject` as parameter for the `partition(key)`? It is not 
necessary to unwrap object here.



##########
modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/QueryIndexRowHandler.java:
##########
@@ -98,68 +108,45 @@ public List<IndexColumn> getH2IdxColumns() {
 
     /** */
     private Object getKey(int idx, CacheDataRow row) {

Review Comment:
   There is a single usage, let's inline this method.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to