You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/07/05 08:25:58 UTC

[GitHub] [iceberg] rdsr commented on a change in pull request #1169: Reset temporary states inside thread local objects

rdsr commented on a change in pull request #1169:
URL: https://github.com/apache/iceberg/pull/1169#discussion_r449850015



##########
File path: api/src/main/java/org/apache/iceberg/expressions/InclusiveMetricsEvaluator.java
##########
@@ -102,7 +102,15 @@ private boolean eval(ContentFile<?> file) {
       this.lowerBounds = file.lowerBounds();
       this.upperBounds = file.upperBounds();
 
-      return ExpressionVisitors.visitEvaluator(expr, this);
+      try {
+        return ExpressionVisitors.visitEvaluator(expr, this);
+      } finally {
+        // allow temporary state to be collected because this is in a thread-local
+        this.valueCounts = null;

Review comment:
       I think this is subtle and hard to understand on why this is needed. I prefer the the new visitor approach as you guys discussed in #1139. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org