timoninmaxim commented on code in PR #10080:
URL: https://github.com/apache/ignite/pull/10080#discussion_r913545731
##########
modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/IndexRowCompartorImpl.java:
##########
@@ -81,15 +81,22 @@ private boolean sameType(IndexKey key, int idxType) {
}
/** */
- private int compare(IndexKey lkey, IndexKey rkey) {
- if (lkey == NullIndexKey.INSTANCE)
- return lkey.compare(rkey);
- else if (rkey == NullIndexKey.INSTANCE)
- return 1;
-
- if (lkey.type() == rkey.type())
- return lkey.compare(rkey);
+ private int compare(IndexKey lkey, IndexKey rkey) throws
IgniteCheckedException {
+ try {
+ if (lkey == NullIndexKey.INSTANCE)
+ return lkey.compare(rkey);
+ else if (rkey == NullIndexKey.INSTANCE)
+ return 1;
+
+ if (lkey.isComparableTo(rkey))
+ return lkey.compare(rkey);
+ else if (rkey.isComparableTo(lkey))
+ return -rkey.compare(lkey);
+ }
+ catch (RuntimeException e) {
Review Comment:
Is the reason for it is that `H2ValueIndexKey#compare` wraps
`IgniteCheckedException` to `RuntimeException`, and in this point you wraps it
again to checked exception. Looks weird, should we just add
`IgniteCheckedException` to `compare` signature instead?
--
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]