maedhroz commented on code in PR #3825:
URL: https://github.com/apache/cassandra/pull/3825#discussion_r1927909954
##########
src/java/org/apache/cassandra/index/sai/iterators/KeyRangeIterator.java:
##########
@@ -229,14 +229,21 @@ protected static PrimaryKey nullSafeMin(PrimaryKey a,
PrimaryKey b)
if (a == null) return b;
if (b == null) return a;
- return a.compareToStrict(b) > 0 ? b : a;
+ return a.compareTo(b) > 0 ? b : a;
}
protected static PrimaryKey nullSafeMax(PrimaryKey a, PrimaryKey b)
{
if (a == null) return b;
if (b == null) return a;
- return a.compareToStrict(b) > 0 ? a : b;
+ // The STATIC key sorts before WIDE keys in its partition, but to
avoid missing rows while
+ // intersecting, the STATIC key must override any WIDE key.
+ if (a.kind() == PrimaryKey.Kind.STATIC && b.kind() ==
PrimaryKey.Kind.WIDE)
+ return a.compareTo(b, false) >= 0 ? a : b;
+ else if (b.kind() == PrimaryKey.Kind.STATIC && a.kind() ==
PrimaryKey.Kind.WIDE)
+ return b.compareTo(a, false) >= 0 ? b : a;
Review Comment:
Revert this block to see `testIntersectionWithStaticUpdate()` fail
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]