You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by ao...@apache.org on 2020/10/29 18:29:21 UTC

[iceberg] branch master updated: Core: Do not create an Evaluator in ManifestGroup unless the file filter is used (#1678)

This is an automated email from the ASF dual-hosted git repository.

aokolnychyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/master by this push:
     new d3e986a  Core: Do not create an Evaluator in ManifestGroup unless the file filter is used (#1678)
d3e986a is described below

commit d3e986ab04151294fdf4622c17bbb91d1fc2af17
Author: Ryan Blue <bl...@apache.org>
AuthorDate: Thu Oct 29 11:29:11 2020 -0700

    Core: Do not create an Evaluator in ManifestGroup unless the file filter is used (#1678)
---
 core/src/main/java/org/apache/iceberg/ManifestGroup.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/iceberg/ManifestGroup.java b/core/src/main/java/org/apache/iceberg/ManifestGroup.java
index 54c809c..529867c 100644
--- a/core/src/main/java/org/apache/iceberg/ManifestGroup.java
+++ b/core/src/main/java/org/apache/iceberg/ManifestGroup.java
@@ -213,7 +213,12 @@ class ManifestGroup {
               spec, caseSensitive);
         });
 
-    Evaluator evaluator = new Evaluator(DataFile.getType(EMPTY_STRUCT), fileFilter, caseSensitive);
+    Evaluator evaluator;
+    if (fileFilter != null && fileFilter != Expressions.alwaysTrue()) {
+      evaluator = new Evaluator(DataFile.getType(EMPTY_STRUCT), fileFilter, caseSensitive);
+    } else {
+      evaluator = null;
+    }
 
     Iterable<ManifestFile> matchingManifests = evalCache == null ? dataManifests :
         Iterables.filter(dataManifests, manifest -> evalCache.get(manifest.partitionSpecId()).eval(manifest));
@@ -255,7 +260,7 @@ class ManifestGroup {
                 entry -> entry.status() != ManifestEntry.Status.EXISTING);
           }
 
-          if (fileFilter != null && fileFilter != Expressions.alwaysTrue()) {
+          if (evaluator != null) {
             entries = CloseableIterable.filter(entries,
                 entry -> evaluator.eval((GenericDataFile) entry.file()));
           }