Fokko commented on code in PR #2029:
URL: https://github.com/apache/iceberg-python/pull/2029#discussion_r2252596499
##########
pyiceberg/expressions/visitors.py:
##########
@@ -910,6 +915,14 @@ def visit_bound_predicate(self, predicate:
BoundPredicate[L]) -> BooleanExpressi
else:
raise ValueError(f"Unsupported predicate: {predicate}")
+ # In the order described by the "Column Projection" section of the
Iceberg spec:
+ # https://iceberg.apache.org/spec/#column-projection
+ # Evaluate column projection first if it exists
+ if projected_field_value :=
self.projected_field_values.get(field.name):
Review Comment:
How about condensing this into:
```python
# In the order described by the "Column Projection" section of the Iceberg
spec:
# https://iceberg.apache.org/spec/#column-projection
# Evaluate column projection first if it exists, otherwise default to the
initial-default-value
field_value = (
self.projected_field_values[field.name] if field.name in
self.projected_field_values else field.initial_default
)
return (
AlwaysTrue()
if expression_evaluator(Schema(field), pred,
case_sensitive=self.case_sensitive)(Record(field_value))
else AlwaysFalse()
)
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]