Skip to content

Commit 7de4744

Browse files
committed
comments
1 parent bc8d5c9 commit 7de4744

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pyiceberg/expressions/visitors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ def visit_bound_predicate(self, predicate: BoundPredicate[L]) -> BooleanExpressi
903903
file_column_name = self.file_schema.find_column_name(field.field_id)
904904

905905
if file_column_name is None:
906-
# In the case of schema evolution or column projection, the column might not be present in the file schema.
906+
# In the case of schema evolution or column projection, the field might not be present in the file schema.
907907
# we can use the projected value or the field's default value as a constant and evaluate it against the predicate
908908
pred: BooleanExpression
909909
if isinstance(predicate, BoundUnaryPredicate):
@@ -915,6 +915,8 @@ def visit_bound_predicate(self, predicate: BoundPredicate[L]) -> BooleanExpressi
915915
else:
916916
raise ValueError(f"Unsupported predicate: {predicate}")
917917

918+
# In the order described by the "Column Projection" section of the Iceberg spec:
919+
# https://iceberg.apache.org/spec/#column-projection
918920
# Evaluate column projection first if it exists
919921
if projected_field_value := self.projected_field_values.get(field.name):
920922
if expression_evaluator(Schema(field), pred, case_sensitive=self.case_sensitive)(Record(projected_field_value)):

0 commit comments

Comments
 (0)