moulimukherjee commented on a change in pull request #283: Add projectStrict
for Dates and Timestamps
URL: https://github.com/apache/incubator-iceberg/pull/283#discussion_r306955551
##########
File path:
api/src/main/java/org/apache/iceberg/expressions/ResidualEvaluator.java
##########
@@ -211,31 +210,48 @@ public Expression or(Expression leftResult, Expression
rightResult) {
return pred; // not associated inclusive a partition field, can't be
evaluated
}
- List<UnboundPredicate<?>> strictProjections = Lists.transform(parts,
- part -> ((Transform<T, ?>)
part.transform()).projectStrict(part.name(), pred));
+ for (PartitionField part : parts) {
- if (Iterables.all(strictProjections, Objects::isNull)) {
- // if there are no strict projections, the predicate must be in the
residual
- return pred;
- }
+ // checking the strict projection
+ UnboundPredicate<?> strictProjection = ((Transform<T, ?>)
part.transform()).projectStrict(part.name(), pred);
+ Expression strictResult = null;
+
+ if (strictProjection != null) {
+ Expression bound = strictProjection.bind(spec.partitionType(),
caseSensitive);
+ if (bound instanceof BoundPredicate) {
+ strictResult = super.predicate((BoundPredicate<?>) bound);
+ } else {
+ strictResult = bound;
+ }
+ }
+
+ if (strictResult != null &&
strictResult.equals(Expressions.alwaysTrue())) {
Review comment:
Ack.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]