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


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/IndexScan.java:
##########
@@ -486,4 +500,48 @@ 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);
+
+        return toRowForPk(key);
+    }
+
+    /** */
+    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();

Review Comment:
   The factory is initiated based on only required columns, so this code fails 
by index out of range if the factory does not have all the index columns.



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