zstan commented on code in PR #13225:
URL: https://github.com/apache/ignite/pull/13225#discussion_r3852764515
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/IndexWrappedKeyScan.java:
##########
@@ -63,22 +63,29 @@ public IndexWrappedKeyScan(
Object key = rowHnd.get(QueryUtils.KEY_COL, bound);
assert key != null : String.format("idxName=%s, bound=%s", idx.name(),
Commons.toString(rowHnd, bound));
- if (key instanceof BinaryObject)
- return binaryObject2indexRow((BinaryObject)key);
+ String idxTypeName =
idx.indexDefinition().typeDescriptor().keyTypeName();
- throw new IgniteException(String.format(
- "Unsupported type for index boundary: [expected=%s, current=%s]",
- BinaryObject.class.getName(), key.getClass().getName()
- ));
+ if (key instanceof BinaryObject bo) {
+ try {
+ String searchTypeName = bo.type().typeName();
+
+ if (!idxTypeName.equals(searchTypeName))
+ // The same behavior as for table scan.
+ return null;
+ }
+ catch (BinaryObjectException ex) {
+ // The same behavior as for table scan.
+ return null;
+ }
+
+ return binaryObject2indexRow(bo);
+ }
+ else
+ throw new AssertionError("Invalid types for comparison: %s
%s".formatted(idxTypeName, key.getClass().getName()));
Review Comment:
But how could it possible if public API allow acces only through Object
related call ?
org.apache.ignite.cache.query.SqlFieldsQuery#setArgs(Object... args)
--
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]