vldpyatkov commented on code in PR #12926:
URL: https://github.com/apache/ignite/pull/12926#discussion_r2996911506


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/IndexScan.java:
##########
@@ -486,4 +500,49 @@ private int compare(IndexRow o1, IndexRow o2) {
             throw new IgniteException(e);
         }
     }
+
+    /** */
+    private Row unwrapKeyFieldForPkIndex(Row row) {
+        RowHandler<Row> rowHnd = ectx.rowHandler();
+
+        Object key = rowHnd.get(QueryUtils.KEY_COL, row);
+        assert key != null : String.format("idxName=%s, row=%s", idx.name(), 
rowHnd.toString(row));
+
+        if (key instanceof BinaryObject)
+            return toRowForPk((BinaryObject)key);
+
+        // TODO: IGNITE-28374 Use 
org.apache.ignite.internal.processors.query.calcite.exec.IndexScan.toRowForPk(java.lang.Object)
+        return row;
+    }
+
+    /** */
+    private Row toRowForPk(BinaryObject o) {
+        assert 
o.type().typeName().equals(idx.indexDefinition().typeDescriptor().keyTypeName())
 : String.format(
+            "idx=%s, o=%s, oType=%s, idxKeyType=%s",
+            idx.name(), o, o.type().typeName(), 
idx.indexDefinition().typeDescriptor().keyTypeName()
+        );
+
+        RowHandler<Row> rowHnd = ectx.rowHandler();
+        Row row = factory.create(idxFieldMapping.getInt(idxFieldMapping.size() 
- 1) + 1);
+
+        for (String keyName : 
idx.indexDefinition().indexKeyDefinitions().keySet()) {
+            ColumnDescriptor fieldDesc = desc.columnDescriptor(keyName);
+            assert fieldDesc != null : String.format("idx=%s, o=%s, 
keyName=%s", idx.name(), o, keyName);
+
+            rowHnd.set(fieldDesc.fieldIndex(), row, o.field(keyName));
+        }
+
+        return row;
+    }
+
+    /** */
+    // TODO: IGNITE-28374 Implement it and use
+    private Row toRowForPk(Object o) {

Review Comment:
   This method is not used.



-- 
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