stevenzwu commented on code in PR #10735:
URL: https://github.com/apache/iceberg/pull/10735#discussion_r1716011494
##########
core/src/main/java/org/apache/iceberg/GenericManifestFile.java:
##########
@@ -105,6 +105,42 @@ public GenericManifestFile(Schema avroSchema) {
this.keyMetadata = null;
}
+ /** Adjust the arg order to avoid conflict with the public constructor below
*/
+ GenericManifestFile(
+ String path,
+ long length,
+ int specId,
+ ManifestContent content,
+ long sequenceNumber,
+ long minSequenceNumber,
+ Long snapshotId,
+ List<PartitionFieldSummary> partitions,
+ ByteBuffer keyMetadata,
+ Integer addedFilesCount,
+ Long addedRowsCount,
+ Integer existingFilesCount,
+ Long existingRowsCount,
+ Integer deletedFilesCount,
+ Long deletedRowsCount) {
+ this.avroSchema = AVRO_SCHEMA;
+ this.manifestPath = path;
+ this.length = length;
+ this.specId = specId;
+ this.content = content;
+ this.sequenceNumber = sequenceNumber;
+ this.minSequenceNumber = minSequenceNumber;
+ this.snapshotId = snapshotId;
+ this.addedFilesCount = addedFilesCount;
+ this.addedRowsCount = addedRowsCount;
+ this.existingFilesCount = existingFilesCount;
+ this.existingRowsCount = existingRowsCount;
+ this.deletedFilesCount = deletedFilesCount;
+ this.deletedRowsCount = deletedRowsCount;
+ this.partitions = partitions == null ? null : partitions.toArray(new
PartitionFieldSummary[0]);
+ this.fromProjectionPos = null;
+ this.keyMetadata = ByteBuffers.toByteArray(keyMetadata);
Review Comment:
`ByteBuffers` handles the null value properly.
```
public class ByteBuffers {
public static byte[] toByteArray(ByteBuffer buffer) {
if (buffer == null) {
return null;
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]