alex-plekhanov commented on code in PR #10080:
URL: https://github.com/apache/ignite/pull/10080#discussion_r914489670
##########
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:
Yes, but there still can be some runtime exceptions (for example
NumberFormatException) in compare method and wrapping of RuntimeExceptions to
IgniteCheckedExceptions is still required.
--
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]