You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "jkolash (via GitHub)" <gi...@apache.org> on 2024/05/01 13:12:56 UTC

[I] org.apache.iceberg.expressions.(Max/Min)Aggregate Don't handle null DataFile.(upper/lower)Bounds() [iceberg]

jkolash opened a new issue, #10258:
URL: https://github.com/apache/iceberg/issues/10258

   ### Apache Iceberg version
   
   1.5.0
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   If you use the snapshot table command and run 
   
   ```select max(intValue) from table``` this can be reproduced. 
   
   The spec says this is optional
   https://iceberg.apache.org/spec/#manifests
   ![image](https://github.com/apache/iceberg/assets/801170/60989007-7323-484c-8d7c-378869e23441)
   
   
   Let me know if you want me to provide a test case/fix as it seems like a pretty simple issue to test/fix for.


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


Re: [I] org.apache.iceberg.expressions.(Max/Min)Aggregate Don't handle null DataFile.(upper/lower)Bounds() [iceberg]

Posted by "jkolash (via GitHub)" <gi...@apache.org>.
jkolash commented on issue #10258:
URL: https://github.com/apache/iceberg/issues/10258#issuecomment-2088445550

   relevant code
   https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/expressions/MaxAggregate.java#L42
   ```java
     @Override
     protected boolean hasValue(DataFile file) {
       boolean hasBound = file.upperBounds().containsKey(fieldId); //NPE here
       Long valueCount = safeGet(file.valueCounts(), fieldId);
       Long nullCount = safeGet(file.nullValueCounts(), fieldId);
       boolean boundAllNull =
           valueCount != null
               && valueCount > 0
               && nullCount != null
               && nullCount.longValue() == valueCount.longValue();
       return hasBound || boundAllNull;
     }
   ```


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


Re: [I] org.apache.iceberg.expressions.(Max/Min)Aggregate Don't handle null DataFile.(upper/lower)Bounds() [iceberg]

Posted by "amogh-jahagirdar (via GitHub)" <gi...@apache.org>.
amogh-jahagirdar commented on issue #10258:
URL: https://github.com/apache/iceberg/issues/10258#issuecomment-2094398927

   > Let me know if you want me to provide a test case/fix as it seems like a pretty simple issue to test/fix for.
   
   @jkolash if you're up for it, feel free to raise a PR! I'm happy to review.


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


Re: [I] org.apache.iceberg.expressions.(Max/Min)Aggregate Don't handle null DataFile.(upper/lower)Bounds() [iceberg]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho closed issue #10258: org.apache.iceberg.expressions.(Max/Min)Aggregate  Don't handle null DataFile.(upper/lower)Bounds() 
URL: https://github.com/apache/iceberg/issues/10258


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