Erigara commented on code in PR #2029:
URL: https://github.com/apache/iceberg-python/pull/2029#discussion_r2143057907


##########
pyiceberg/expressions/visitors.py:
##########
@@ -894,12 +895,17 @@ def visit_unbound_predicate(self, predicate: 
UnboundPredicate[L]) -> BooleanExpr
 
     def visit_bound_predicate(self, predicate: BoundPredicate[L]) -> 
BooleanExpression:
         file_column_name = 
self.file_schema.find_column_name(predicate.term.ref().field.field_id)
+        field_name = predicate.term.ref().field.name
 
         if file_column_name is None:
             # In the case of schema evolution, the column might not be present
             # in the file schema when reading older data
             if isinstance(predicate, BoundIsNull):
                 return AlwaysTrue()
+            # Projected fields are only available for identity partition fields
+            # Which mean that partition pruning excluded partition field which 
evaluates to false
+            elif field_name in self.projected_missing_fields:
+                return AlwaysTrue()

Review Comment:
   Hello @Fokko, i've added a test which showcase what changed in term of 
predicate evaluation.
   
   However strictly speaking it's not directly runnable on current main because 
in the patch i've extended changed signature of `translate_column_names` method.
   I've split my patch in 3 commits to showcase difference:
   1.  just extend schema and rearrange code to pass arguments (no behavior 
differences)
   2. add test (test fails)
   3. add code to evaluate projected field (test passes)
   
   So does it count? :)
   
   
   
   So does it count? :) 



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

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


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

Reply via email to