mzzz-zzm commented on code in PR #1039:
URL: https://github.com/apache/iceberg-go/pull/1039#discussion_r3212404144


##########
manifest.go:
##########
@@ -944,6 +944,19 @@ func (v3writerImpl) prepareEntry(entry *manifestEntry, 
snapshotID int64) (Manife
                }
        }
 
+       // v3 spec deprecates data_file.distinct_counts (parity with Java
+       // apache/iceberg#12182). Today none of the per-version Avro schemas in
+       // internal/avro_schemas.go declare distinct_counts, so the field is
+       // already dropped on encode for every version. This guard is
+       // forward-compatibility insurance: if the v2 schema is later fixed to
+       // declare distinct_counts (v2 spec requires it; tracked separately), 
the
+       // v3 path stays compliant by clearing the Avro-facing pointer here. The
+       // cached distinctCntMap and DistinctValueCounts() getter are left alone
+       // so in-memory readers in the same process keep their view.
+       if df, ok := entry.DataFile().(*dataFile); ok {

Review Comment:
   Fixed. The comment now calls this out explicitly:
   
   ```go
   Best-effort: only the in-tree *dataFile is cleared; third-party DataFile 
impls bypass this guard.



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