From b4f280392d09233264c657c74171c09ca0806553 Mon Sep 17 00:00:00 2001 From: Marius Grama Date: Wed, 27 Dec 2023 14:53:35 +0100 Subject: [PATCH] Strip the partition columns domains from the effective predicate --- .../io/trino/plugin/iceberg/IcebergPageSourceProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergPageSourceProvider.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergPageSourceProvider.java index 678c53282d63..22cef9576b14 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergPageSourceProvider.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergPageSourceProvider.java @@ -429,7 +429,9 @@ private TupleDomain getEffectivePredicate( if (!partitionMatchesPredicate(partitionColumns, partitionValues, dynamicFilterPredicate)) { return TupleDomain.none(); } - + // Filter out partition columns domains from the dynamic filter because they should be irrelevant at data file level + dynamicFilterPredicate = dynamicFilterPredicate + .filter((columnHandle, domain) -> !partitionKeys.containsKey(columnHandle.getId())); return unenforcedPredicate.intersect(dynamicFilterPredicate); }