Skip to content

Commit da75020

Browse files
committed
fix
1 parent 80e581f commit da75020

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

paimon-core/src/main/java/org/apache/paimon/mergetree/compact/OffPeakHours.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static OffPeakHours create(CoreOptions options) {
5454
}
5555

5656
public static OffPeakHours create(int startHour, int endHour, int compactOffPeakRatio) {
57-
if (startHour == -1 && endHour == -1) {
57+
if (startHour == -1 || endHour == -1) {
5858
return null;
5959
}
6060

paimon-core/src/test/java/org/apache/paimon/mergetree/compact/OffPeakHoursTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ void testCreateFromOptionsWithSameHour() {
7070
void testCreateWithInvalidHours() {
7171
assertThat(OffPeakHours.create(-1, -1, RATIO)).isNull();
7272
assertThat(OffPeakHours.create(5, 5, RATIO)).isNull();
73+
assertThat(OffPeakHours.create(2, -1, RATIO)).isNull();
74+
assertThat(OffPeakHours.create(-1, 2, RATIO)).isNull();
7375
}
7476

7577
@Test

0 commit comments

Comments
 (0)