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 2023/01/10 16:40:23 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #6555: Python: Expression to disjunctive normal form

rdblue commented on code in PR #6555:
URL: https://github.com/apache/iceberg/pull/6555#discussion_r1066013273


##########
python/pyiceberg/expressions/visitors.py:
##########
@@ -842,3 +842,59 @@ def visit_bound_predicate(self, predicate: BoundPredicate[L]) -> Set[int]:
 
 def extract_field_ids(expr: BooleanExpression) -> Set[int]:
     return visit(expr, _ExpressionFieldIDs())
+
+
+class _RewriteToDNF(BooleanExpressionVisitor[BooleanExpression]):
+    def visit_true(self) -> BooleanExpression:
+        return AlwaysTrue()
+
+    def visit_false(self) -> BooleanExpression:
+        return AlwaysFalse()
+
+    def visit_not(self, child_result: BooleanExpression) -> BooleanExpression:

Review Comment:
   @Fokko, can this be handled by running `rewriteNot` before this visitor is applied? That should avoid the need to have so much logic here.



-- 
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-unsubscribe@iceberg.apache.org

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