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/07/29 03:46:42 UTC

[GitHub] [iceberg] openinx commented on a change in pull request #2852: Core: Fix the NPE in DataFiles.Builder#copy

openinx commented on a change in pull request #2852:
URL: https://github.com/apache/iceberg/pull/2852#discussion_r678800656



##########
File path: core/src/main/java/org/apache/iceberg/DataFiles.java
##########
@@ -176,7 +176,7 @@ public Builder copy(DataFile toCopy) {
       this.keyMetadata = toCopy.keyMetadata() == null ? null
           : ByteBuffers.copy(toCopy.keyMetadata());
       this.splitOffsets = toCopy.splitOffsets() == null ? null : copyList(toCopy.splitOffsets());
-      this.sortOrderId = toCopy.sortOrderId();
+      this.sortOrderId = toCopy.sortOrderId() == null ? SortOrder.unsorted().orderId() : toCopy.sortOrderId();

Review comment:
       Yes, I think changing the field to be `Integer` is enough to address this issue.




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