dwilson1988 commented on code in PR #177: URL: https://github.com/apache/iceberg-go/pull/177#discussion_r1813443609
########## manifest.go: ########## @@ -876,7 +1030,140 @@ func (m *manifestEntryV2) FileSequenceNum() *int64 { return m.FileSeqNum } -func (m *manifestEntryV2) DataFile() DataFile { return &m.Data } +func (m *manifestEntryV2) DataFile() DataFile { return m.Data } + +// DataFileBuilder is a helper for building a data file struct which will +// conform to the DataFile interface. +type DataFileBuilder struct { + d *dataFile +} + +// NewDataFileBuilder is passed all of the required fields and then allows +// all of the optional fields to be set by calling the corresponding methods +// before calling [DataFileBuilder.Build] to construct the object. +func NewDataFileBuilder( + content ManifestEntryContent, + path string, + format FileFormat, + partitionData map[string]any, + recordCount int64, + fileSize int64, +) *DataFileBuilder { + return &DataFileBuilder{ + d: &dataFile{ + Content: content, + Path: path, + Format: format, + PartitionData: partitionData, + RecordCount: recordCount, + FileSize: fileSize, + }, + } +} Review Comment: Just so I'm understanding your ask: 1. path should be non-empty 2. format should be a valid format 3. recordCount should be greater than 0 4. fileSize should be greater than 0 Anything else? -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org