use of org.apache.ignite.internal.cache.query.index.sorted.inline.types.NullableInlineIndexKeyType in project ignite by apache.
the class H2RowComparator method compareKey.
/**
* {@inheritDoc}
*/
@Override
public int compareKey(long pageAddr, int off, int maxSize, IndexKey key, InlineIndexKeyType type) {
int cmp = super.compareKey(pageAddr, off, maxSize, key, type);
if (cmp != COMPARE_UNSUPPORTED)
return cmp;
int objType = key == NullIndexKey.INSTANCE ? type.type() : key.type();
int highOrder = Value.getHigherOrder(type.type(), objType);
// H2 supports comparison between different types after casting them to single type.
if (highOrder != objType && highOrder == type.type()) {
Value va = DataType.convertToValue(ses, key.key(), highOrder);
va = va.convertTo(highOrder);
IndexKey objHighOrder = IndexKeyFactory.wrap(va.getObject(), highOrder, coctx, keyTypeSettings);
InlineIndexKeyType highType = InlineIndexKeyTypeRegistry.get(objHighOrder, highOrder, keyTypeSettings);
// The only way to invoke inline comparison again.
if (highType != null)
return ((NullableInlineIndexKeyType) highType).compare0(pageAddr, off, objHighOrder);
}
return COMPARE_UNSUPPORTED;
}
Aggregations