Skip to content

Commit 5fcb6d6

Browse files
fix tests
Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
1 parent 2b76ea0 commit 5fcb6d6

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/iceberg_predicate.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -671,12 +671,13 @@ static bool MatchBoundsFromExpressionTemplated(ClientContext &context, const Exp
671671
return true;
672672
}
673673
case ExpressionType::OPERATOR_NOT: {
674-
//! NOT inverts the result of child expression
675-
auto &op = expr.Cast<BoundOperatorExpression>();
676-
if (op.children.size() != 1) {
677-
return true;
678-
}
679-
return !MatchBoundsFromExpressionTemplated<TRANSFORM>(context, *op.children[0], stats, transform);
674+
//! NOT expressions cannot be pruned with simple inversion.
675+
//! MatchBounds returns true="might match some rows" or false="definitely no rows match".
676+
//! For NOT expr:
677+
//! - If child returns true (some rows might match expr), file might also have rows NOT matching expr
678+
//! - If child returns false (no rows match expr), ALL rows match NOT expr
679+
//! In both cases we cannot prune, so always return true (conservative).
680+
return true;
680681
}
681682

682683
//! === COMPARISON OPERATORS ===

0 commit comments

Comments
 (0)