kbendick commented on code in PR #4721:
URL: https://github.com/apache/iceberg/pull/4721#discussion_r867425912
##########
api/src/main/java/org/apache/iceberg/transforms/Truncate.java:
##########
@@ -288,6 +288,7 @@ public UnboundPredicate<CharSequence> project(String name,
BoundLiteralPredicate<CharSequence> pred =
predicate.asLiteralPredicate();
switch (pred.op()) {
case STARTS_WITH:
+ case ENDS_WITH:
Review Comment:
I'm not sure that the `STARTS_WITH` truncate logic can be reused entirely.
The `ProjectionUtil.truncateArray` initially seems suspect to me. As we're
concerned with the end of the string, truncating seems like not the best option.
For the cases where `width` is less than or equal to the value's length,
these two should be ok.
The safest thing to do (which wouldn't be optimal in terms of filter
pushdown) would be simply to return `null` instead of truncating the predicate,
as we are concerned with the end of the string, and truncation will have
removed that (making it not comparable for certain levels of file pruning).
--
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]