rdblue commented on a change in pull request #2349:
URL: https://github.com/apache/iceberg/pull/2349#discussion_r600824358



##########
File path: core/src/main/java/org/apache/iceberg/GenericManifestFile.java
##########
@@ -145,7 +145,12 @@ private GenericManifestFile(GenericManifestFile toCopy) {
     this.existingRowsCount = toCopy.existingRowsCount;
     this.deletedFilesCount = toCopy.deletedFilesCount;
     this.deletedRowsCount = toCopy.deletedRowsCount;
-    this.partitions = copyList(toCopy.partitions, PartitionFieldSummary::copy);
+    if (toCopy.partitions != null) {
+      this.partitions = copyList(toCopy.partitions(), 
PartitionFieldSummary::copy)
+          .toArray(new PartitionFieldSummary[0]);

Review comment:
       Do we need to use `copyList`? What about using a Stream instead?
   
   ```java
   
Streams.of(toCopy.partitions).map(PartitionFieldSummary::copy).toArray(PartitionFieldSummary[]::new);
   ```




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to