tanmayrauth commented on code in PR #890:
URL: https://github.com/apache/iceberg-go/pull/890#discussion_r3089982779


##########
manifest.go:
##########
@@ -158,154 +158,81 @@ func (b *ManifestBuilder) Build() ManifestFile {
        return b.m
 }
 
-type fallbackManifestFileV1 struct {
-       manifestFileV1
-       AddedSnapshotID *int64 `avro:"added_snapshot_id"`
-}
-
-func (f *fallbackManifestFileV1) toFile() *manifestFile {
-       if f.AddedSnapshotID == nil {
-               f.manifestFileV1.AddedSnapshotID = -1
-       }
-
-       return f.manifestFileV1.toFile()
-}
-
+// manifestFileV1 is a read/write struct for V1 manifest list entries.
+// Pointer fields handle nullable Avro types (["null", T] unions).
+// The three count fields carry aliases for pre-1.4 Java Iceberg legacy names
+// (apache/iceberg#5338) so that avro.Resolve maps them transparently.
 type manifestFileV1 struct {
-       manifestFile
-       AddedFilesCount    *int32 `avro:"added_files_count"`
-       ExistingFilesCount *int32 `avro:"existing_files_count"`
-       DeletedFilesCount  *int32 `avro:"deleted_files_count"`
-       AddedRowsCount     *int64 `avro:"added_rows_count"`
-       ExistingRowsCount  *int64 `avro:"existing_rows_count"`
-       DeletedRowsCount   *int64 `avro:"deleted_rows_count"`
+       Path               string          `avro:"manifest_path"`
+       Len                int64           `avro:"manifest_length"`
+       SpecID             int32           `avro:"partition_spec_id"`
+       AddedSnapshotID    *int64          `avro:"added_snapshot_id"`

Review Comment:
   Since we now use ocf.WithReaderSchemaFunc for schema resolution, Avro 
handles promotion of required long → ["null", "long"] automatically. When the 
writer has added_snapshot_id as required, the decoded pointer will always be 
non-nil. The old fallbackManifestFileV1 was needed because the  code decoded 
without schema resolution and had to inspect the writer schema at runtime.    



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

Reply via email to