Fokko commented on code in PR #6892:
URL: https://github.com/apache/iceberg/pull/6892#discussion_r1116074934
##########
python/pyiceberg/expressions/visitors.py:
##########
@@ -482,6 +502,12 @@ def visit_less_than(self, term: BoundTerm[L], literal:
Literal[L]) -> bool:
def visit_less_than_or_equal(self, term: BoundTerm[L], literal:
Literal[L]) -> bool:
return term.eval(self.struct) <= literal.value
+ def visit_starts_with(self, term: BoundTerm[L], literal: Literal[L]) ->
bool:
+ return str(term.eval(self.struct)).startswith(str(literal.value))
Review Comment:
This looks good to me. Can you make sure that we port the tests from Java
also to Python:
https://github.com/apache/iceberg/blob/master/api/src/test/java/org/apache/iceberg/expressions/TestEvaluator.java#L289-L321
This is a very important part of PyIceberg, and we need to make sure that
this is tested to avoid correctness issues.
--
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]