smaheshwar-pltr commented on code in PR #14012:
URL: https://github.com/apache/iceberg/pull/14012#discussion_r2328751546


##########
api/src/main/java/org/apache/iceberg/transforms/Truncate.java:
##########
@@ -382,7 +382,7 @@ public UnboundPredicate<CharSequence> projectStrict(
               return Expressions.notEqual(name, pred.literal().value());
             }
 
-            return Expressions.predicate(pred.op(), name, 
apply(pred.literal().value()).toString());
+            return ProjectionUtil.truncateArrayStrict(name, pred, this);

Review Comment:
   Motivation: the `STARTS_WITH` inclusive counterpart to this invokes 
`ProjectionUtil.truncateArray` here 
https://github.com/apache/iceberg/blob/7b9ea75ebe93801eaa908c28e9ef18ab205ffb80/api/src/main/java/org/apache/iceberg/transforms/Truncate.java#L330-L337
   
   instead of applying the truncation inline.
   
   However, the `NOT_STARTS_WITH` code here, prior to this PR, applies the 
truncation inline instead of that logic residing in `truncateArrayStrict`. This 
PR addresses this disparity - it also means that `apply` methods are now no 
longer called directly from this file.



##########
api/src/main/java/org/apache/iceberg/transforms/Truncate.java:
##########
@@ -382,7 +382,7 @@ public UnboundPredicate<CharSequence> projectStrict(
               return Expressions.notEqual(name, pred.literal().value());
             }
 
-            return Expressions.predicate(pred.op(), name, 
apply(pred.literal().value()).toString());
+            return ProjectionUtil.truncateArrayStrict(name, pred, this);

Review Comment:
   Motivation: the `STARTS_WITH` inclusive counterpart to this invokes 
`ProjectionUtil.truncateArray` here 
https://github.com/apache/iceberg/blob/7b9ea75ebe93801eaa908c28e9ef18ab205ffb80/api/src/main/java/org/apache/iceberg/transforms/Truncate.java#L330-L337
   
   instead of applying the truncation inline.
   
   However, the `NOT_STARTS_WITH` code here, prior to this PR, applies the 
truncation inline instead of that logic residing in `truncateArrayStrict`. This 
PR addresses this disparity - it also means that `apply` methods are now no 
longer called directly in this file.



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