Skip to content

Commit 2e8ba22

Browse files
committed
PARQUET-34: Assert that size(lt 0) is invalid
1 parent d2e8dc3 commit 2e8ba22

File tree

1 file changed

+2
-2
lines changed
  • parquet-column/src/main/java/org/apache/parquet/filter2/predicate

1 file changed

+2
-2
lines changed

parquet-column/src/main/java/org/apache/parquet/filter2/predicate/Operators.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,8 @@ public enum Operator {
521521
Size(Column<?> column, Operator operator, int value) {
522522
this.column = column;
523523
this.operator = operator;
524-
if (value < 0) {
525-
throw new IllegalArgumentException("Argument to size() operator cannot be negative: " + value);
524+
if (value < 0 || (operator == Operator.LT && value == 0)) {
525+
throw new IllegalArgumentException("Invalid predicate " + this + ": array size can never be negative");
526526
}
527527
this.value = value;
528528
}

0 commit comments

Comments
 (0)