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


##########
python/pyiceberg/expressions/visitors.py:
##########
@@ -881,3 +881,82 @@ def rewrite_to_dnf(expr: BooleanExpression) -> 
Tuple[BooleanExpression, ...]:
     # (A AND NOT(B) AND C) OR (NOT(D) AND E AND F) OR (G)
     expr_without_not = rewrite_not(expr)
     return visit(expr_without_not, _RewriteToDNF())
+
+
+class ExpressionToPlainFormat(BoundBooleanExpressionVisitor[List[Tuple[str, 
str, Any]]]):
+    def visit_in(self, term: BoundTerm[L], literals: Set[L]) -> 
List[Tuple[str, str, Any]]:
+        return [(term.ref().field.name, "in", literals)]
+
+    def visit_not_in(self, term: BoundTerm[L], literals: Set[L]) -> 
List[Tuple[str, str, Any]]:
+        return [(term.ref().field.name, "not in", literals)]
+
+    def visit_is_nan(self, term: BoundTerm[L]) -> List[Tuple[str, str, Any]]:
+        return [(term.ref().field.name, "==", float("nan"))]
+
+    def visit_not_nan(self, term: BoundTerm[L]) -> List[Tuple[str, str, Any]]:
+        return [(term.ref().field.name, "!=", float("nan"))]

Review Comment:
   NaN is always not equal to itself, at least in Java. Are we sure that this 
works?



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

Reply via email to