Skip to content

Commit 57d8b09

Browse files
committed
fix
1 parent 38bceb4 commit 57d8b09

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

paimon-core/src/main/java/org/apache/paimon/mergetree/SortedRun.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
package org.apache.paimon.mergetree;
2020

2121
import org.apache.paimon.annotation.VisibleForTesting;
22-
import org.apache.paimon.data.BinaryRow;
2322
import org.apache.paimon.data.InternalRow;
2423
import org.apache.paimon.io.DataFileMeta;
24+
import org.apache.paimon.utils.Preconditions;
2525

2626
import java.util.Collections;
2727
import java.util.Comparator;
@@ -87,13 +87,9 @@ public long totalSize() {
8787
@VisibleForTesting
8888
public void validate(Comparator<InternalRow> comparator) {
8989
for (int i = 1; i < files.size(); i++) {
90-
BinaryRow minKey = files.get(i).minKey();
91-
BinaryRow maxKey = files.get(i - 1).maxKey();
92-
if (comparator.compare(minKey, maxKey) <= 0) {
93-
throw new IllegalArgumentException(
94-
"SortedRun is not sorted and may contain overlapping key intervals. "
95-
+ "This is a bug.");
96-
}
90+
Preconditions.checkState(
91+
comparator.compare(files.get(i).minKey(), files.get(i - 1).maxKey()) > 0,
92+
"SortedRun is not sorted and may contain overlapping key intervals. This is a bug.");
9793
}
9894
}
9995

0 commit comments

Comments
 (0)