kbendick commented on a change in pull request #2062:
URL: https://github.com/apache/iceberg/pull/2062#discussion_r554894135
##########
File path:
api/src/main/java/org/apache/iceberg/expressions/InclusiveMetricsEvaluator.java
##########
@@ -372,6 +372,38 @@ public Boolean or(Boolean leftResult, Boolean rightResult)
{
return ROWS_MIGHT_MATCH;
}
+ @Override
+ public <T> Boolean notStartsWith(BoundReference<T> ref, Literal<T> lit) {
Review comment:
notStartsWith can't necessarily be stood in for !startsWith depending on
the situation.
Here's a quote from @rdblue on the original ticket.
```
Yes, I think we will need a NotStartsWith to handle this.
We can't keep the Not after rewriting because some evaluation doesn't
support negation.
For example, when lower and upper bounds are used to evaluate whether to
read a file,
the result may be true to indicate that the value may be contained in the
file.
That should not be negated because it does not confirm that the value is
definitely in the file:
if looking for files that "do not contain X", we can't use "not(file might
contain X)".
```
However, in situations where we believe it can be, I would agree the
reducing unneeded code is a good way to go. But given that we're dealing with
ROWS_MIGHT_MATCH, my understanding is that we're not necessarily able to negate
that as all rows don't necessarily match. So rows in a file could very well be
`ROWS_MIGHT_MATCH` for startsWith as well as for notStartsWith.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]