rdblue commented on code in PR #6247:
URL: https://github.com/apache/iceberg/pull/6247#discussion_r1032836212
##########
python/pyiceberg/expressions/visitors.py:
##########
@@ -691,3 +692,68 @@ def manifest_evaluator(
partition_schema = Schema(*partition_type.fields)
evaluator = _ManifestEvalVisitor(partition_schema, partition_filter,
case_sensitive)
return evaluator.eval
+
+
+class ProjectionEvaluator(BooleanExpressionVisitor[BooleanExpression], ABC):
+ schema: Schema
+ spec: PartitionSpec
+ case_sensitive: bool
+
+ def __init__(self, schema: Schema, spec: PartitionSpec, case_sensitive:
bool):
+ self.schema = schema
+ self.spec = spec
+ self.case_sensitive = case_sensitive
+
+ def project(self, expr: BooleanExpression) -> BooleanExpression:
+ # projections assume that there are no NOT nodes in the expression
tree. to ensure that this
+ # is the case, the expression is rewritten to push all NOT nodes down
to the expression
+ # leaf nodes.
+ # this is necessary to ensure that the default expression returned
when a predicate can't be
+ # projected is correct.
+ return rewrite_not(expr)
Review Comment:
This doesn't look correct to me because it only rewrites not and returns. I
think this should visit the rewritten expression.
--
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]