rdblue commented on a change in pull request #203: Support multiple partitions 
derived from the same field
URL: https://github.com/apache/incubator-iceberg/pull/203#discussion_r293077769
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/expressions/Projections.java
 ##########
 @@ -205,20 +206,27 @@ private InclusiveProjection(PartitionSpec spec, boolean 
caseSensitive) {
     @Override
     @SuppressWarnings("unchecked")
     public <T> Expression predicate(BoundPredicate<T> pred) {
-      PartitionField part = spec().getFieldBySourceId(pred.ref().fieldId());
-      if (part == null) {
+      Collection<PartitionField> parts = 
spec().getFieldsBySourceId(pred.ref().fieldId());
+      if (parts == null) {
 
 Review comment:
   This could be null or empty because the predicate may be for a field that 
does not have partition columns. Say I have a table partitioned by 
`date(event_time), identity(log_level)` and I filter by `message = "some log 
msg"`. In that case, the reference is for the `message` field, which is not the 
source for any partition fields.
   
   You might be talking about how the multimap will return an empty list, but I 
don't want to rely on that behavior if it changes in the future. When this was 
a singular lookup, it would return null, so I think it makes sense to still be 
defensive here.

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

Reply via email to