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 2022/05/08 02:46:25 UTC

[GitHub] [iceberg] kbendick commented on a diff in pull request #4721: API: Introduce endWiths Predicate.

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