You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "alliasgher (via GitHub)" <gi...@apache.org> on 2026/04/13 19:01:38 UTC
[PR] refactor(table): collapse DataFileStatistics.ToDataFile args into DataFileOpts [iceberg-go]
alliasgher opened a new pull request, #888:
URL: https://github.com/apache/iceberg-go/pull/888
## Summary
Follow-up to the review comment on [#875](https://github.com/apache/iceberg-go/pull/875#discussion_r3074078181) — `DataFileStatistics.ToDataFile` grew to eight positional arguments including two adjacent `int`s (`filesize` and `sortOrderID`), which is hard to read at call sites and easy to swap by mistake.
This PR collapses the parameters into a `DataFileOpts` struct:
```go
type DataFileOpts struct {
Schema *iceberg.Schema
Spec iceberg.PartitionSpec
Path string
Format iceberg.FileFormat
Content iceberg.ManifestEntryContent
FileSize int64
PartitionValues map[int]any
SortOrderID int
}
func (d *DataFileStatistics) ToDataFile(opts DataFileOpts) iceberg.DataFile
```
All six call sites (two production, four tests) are updated to the named-field form. Future additions are source-compatible.
## Notes
- Stacked on #875 — this PR will show both diffs until #875 merges, at which point only the refactor remains.
- No behaviour change.
## Test plan
- [x] `go test ./...`
- [x] `gofmt` clean
Signed-off-by: Ali <al...@gmail.com>
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] refactor(table): collapse DataFileStatistics.ToDataFile args into DataFileOpts [iceberg-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade merged PR #888:
URL: https://github.com/apache/iceberg-go/pull/888
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org