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 2021/04/25 08:34:52 UTC

[GitHub] [iceberg] chenjunjiedada edited a comment on issue #2405: NPE when reading metadata for manifests.

chenjunjiedada edited a comment on issue #2405:
URL: https://github.com/apache/iceberg/issues/2405#issuecomment-826281826


   Still hit this problem.  Now I know how to reproduce this.
   
   1. Write the iceberg table with the 0.10.0 version.
   2. Read the iceberg table manifests with the 0.11.1 version.
   
   `ManifestTable.partitionSummarirsToRows` puts `summary.containsNaN` to the spark row which will be parsed to `Boolean` class and show out.
   
   The following code could fix the issue but I think we should consider with #2495 as well:
   ```
   --- a/api/src/main/java/org/apache/iceberg/ManifestFile.java
   +++ b/api/src/main/java/org/apache/iceberg/ManifestFile.java
   @@ -207,7 +207,7 @@ public interface ManifestFile {
         * Default to return null to ensure backward compatibility.
         */
        default Boolean containsNaN() {
   -      return null;
   +      return true;
        }
    
        /**
   --- a/core/src/main/java/org/apache/iceberg/GenericPartitionFieldSummary.java
   +++ b/core/src/main/java/org/apache/iceberg/GenericPartitionFieldSummary.java
   @@ -121,7 +121,7 @@ public class GenericPartitionFieldSummary
    
      @Override
      public Boolean containsNaN() {
   -    return containsNaN;
   +    return containsNaN == null || containsNull;
      }
   ```
   
   @RussellSpitzer @yyanyy 


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org