@@ -162,9 +162,11 @@ private static List<RowRange> splitOnLargeRowKey(RowRange range, ByteString larg
162162 ByteString startKey = StartPoint .extract (range ).value ;
163163 ByteString endKey = EndPoint .extract (range ).value ;
164164
165- // if end key is on the left of large row key, don't split. Empty endKey means it's unbounded
166- // so it's always on the right of the large key
167- if (!endKey .isEmpty () && ByteStringComparator .INSTANCE .compare (endKey , largeRowKey ) < 0 ) {
165+ // Empty endKey means it's unbounded
166+ boolean boundedEnd = !endKey .isEmpty ();
167+
168+ // if end key is on the left of large row key, don't split.
169+ if (boundedEnd && ByteStringComparator .INSTANCE .compare (endKey , largeRowKey ) < 0 ) {
168170 rowRanges .add (range );
169171 return rowRanges ;
170172 }
@@ -182,8 +184,8 @@ private static List<RowRange> splitOnLargeRowKey(RowRange range, ByteString larg
182184 }
183185
184186 // if the end key is on the right of the large row key, set the start key to be large row key
185- // open. Empty end key is unbounded so it's always on the right of the large key
186- if (endKey . isEmpty () || ByteStringComparator .INSTANCE .compare (endKey , largeRowKey ) > 0 ) {
187+ // open.
188+ if (! boundedEnd || ByteStringComparator .INSTANCE .compare (endKey , largeRowKey ) > 0 ) {
187189 // handle the edge case where (key, key\0) is an empty range and should be excluded
188190 ByteString nextKey = largeRowKey .concat (ByteString .copyFrom (new byte [] {0 }));
189191 EndPoint endPoint = EndPoint .extract (range );
0 commit comments