This is an automated email from the ASF dual-hosted git repository.
zeroshade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-go.git
The following commit(s) were added to refs/heads/main by this push:
new fc6f3d9b9 refactor(manifest)!: name manifest builder constructor
explicitly (#2314)
fc6f3d9b9 is described below
commit fc6f3d9b965b1a4dd1fa74c491aebf367c6061a4
Author: Minh Vu <[email protected]>
AuthorDate: Mon Oct 26 19:30:18 2026 +0100
refactor(manifest)!: name manifest builder constructor explicitly (#2314)
* refactor(manifest)!: name manifest builder constructor explicitly
Rename NewManifestFile to NewManifestBuilder to match the returned type and
other public builder constructors.
Signed-off-by: Minh Vu <[email protected]>
* docs(release): note v1 API compatibility change
* chore: sync release notes with main to resolve conflicts
---------
Signed-off-by: Minh Vu <[email protected]>
Co-authored-by: Matt Topol <[email protected]>
---
manifest.go | 3 +-
manifest_list_version_test.go | 10 ++--
manifest_test.go | 64 +++++++++++-----------
table/all_manifests_internal_test.go | 2 +-
table/evaluator_race_test.go | 2 +-
table/evaluators_bench_test.go | 2 +-
table/evaluators_invalid_bounds_test.go | 2 +-
table/evaluators_test.go | 6 +-
table/in_predicate_extrema_bench_test.go | 2 +-
table/in_predicate_extrema_test.go | 2 +-
table/inspect_internal_test.go | 36 ++++++------
table/inspect_snapshot_prefetch_test.go | 14 ++---
table/maintenance/manifest_test_helpers_test.go | 2 +-
table/manifest_content_cache_internal_test.go | 36 ++++++------
table/manifest_file_ref_test.go | 4 +-
table/rewrite_manifests_internal_test.go | 8 +--
.../scan_task_finalization_planfiles_bench_test.go | 2 +-
table/scanner_internal_test.go | 34 ++++++------
table/scanner_manifest_projection_test.go | 2 +-
table/scanner_plan_tasks_bench_test.go | 2 +-
table/scanner_row_limit_bench_test.go | 2 +-
table/scanner_row_limit_test.go | 2 +-
table/snapshot_manifest_cache_internal_test.go | 14 ++---
table/snapshot_producers_test.go | 12 ++--
table/snapshots.go | 2 +-
table/updates_test.go | 2 +-
26 files changed, 135 insertions(+), 134 deletions(-)
diff --git a/manifest.go b/manifest.go
index eed525b1d..d9ca43c6a 100644
--- a/manifest.go
+++ b/manifest.go
@@ -75,7 +75,8 @@ type ManifestBuilder struct {
m *manifestFile
}
-func NewManifestFile(version int, path string, length int64, partitionSpecID
int32, addedSnapshotID int64) *ManifestBuilder {
+// NewManifestBuilder creates a builder for a manifest file of the given
format version.
+func NewManifestBuilder(version int, path string, length int64,
partitionSpecID int32, addedSnapshotID int64) *ManifestBuilder {
var seqNum int64
if version != 1 {
seqNum = -1
diff --git a/manifest_list_version_test.go b/manifest_list_version_test.go
index da00ac113..c7870d791 100644
--- a/manifest_list_version_test.go
+++ b/manifest_list_version_test.go
@@ -124,7 +124,7 @@ func stripFormatVersion(t *testing.T, data []byte) []byte {
// min_sequence_number, and first_row_id.
func TestReadManifestListInfersVersionWhenKeyAbsent(t *testing.T) {
t.Run("v2", func(t *testing.T) {
- deletes := NewManifestFile(2,
"s3://bucket/metadata/deletes-m0.avro", 100, 0, 42).
+ deletes := NewManifestBuilder(2,
"s3://bucket/metadata/deletes-m0.avro", 100, 0, 42).
Content(ManifestContentDeletes).
SequenceNum(5, 3).
Build()
@@ -145,11 +145,11 @@ func TestReadManifestListInfersVersionWhenKeyAbsent(t
*testing.T) {
})
t.Run("v3", func(t *testing.T) {
- data := NewManifestFile(3, "s3://bucket/metadata/data-m0.avro",
100, 0, 42).
+ data := NewManifestBuilder(3,
"s3://bucket/metadata/data-m0.avro", 100, 0, 42).
AddedRows(10).
SequenceNum(5, 5).
Build()
- deletes := NewManifestFile(3,
"s3://bucket/metadata/deletes-m1.avro", 100, 0, 42).
+ deletes := NewManifestBuilder(3,
"s3://bucket/metadata/deletes-m1.avro", 100, 0, 42).
Content(ManifestContentDeletes).
SequenceNum(5, 3).
Build()
@@ -178,7 +178,7 @@ func TestReadManifestListInfersVersionWhenKeyAbsent(t
*testing.T) {
// genuine v1 manifest list without the optional key must still decode as v1,
// identically to the same list with the key present.
func TestReadManifestListKeylessV1ReadsAsV1(t *testing.T) {
- mf := NewManifestFile(1, "s3://bucket/metadata/data-m0.avro", 100, 0,
7).
+ mf := NewManifestBuilder(1, "s3://bucket/metadata/data-m0.avro", 100,
0, 7).
AddedFiles(1).
AddedRows(10).
Build()
@@ -238,7 +238,7 @@ func TestReadManifestListKeyContradictsSchema(t *testing.T)
{
{writeVersion: 3, claimedKey: "2"},
}
for _, tc := range cases {
- mf := NewManifestFile(tc.writeVersion,
"s3://bucket/metadata/deletes-m0.avro", 100, 0, 42).
+ mf := NewManifestBuilder(tc.writeVersion,
"s3://bucket/metadata/deletes-m0.avro", 100, 0, 42).
Content(ManifestContentDeletes).
SequenceNum(5, 3).
Build()
diff --git a/manifest_test.go b/manifest_test.go
index e139e5ef4..41ee590b5 100644
--- a/manifest_test.go
+++ b/manifest_test.go
@@ -50,7 +50,7 @@ var (
snapshotID int64 = 9182715666859759686
addedRows int64 = 237993
manifestFileRecordsV1 = []ManifestFile{
- NewManifestFile(1,
"/home/iceberg/warehouse/nyc/taxis_partitioned/metadata/0125c686-8aa6-4502-bdcc-b6d17ca41a3b-m0.avro",
+ NewManifestBuilder(1,
"/home/iceberg/warehouse/nyc/taxis_partitioned/metadata/0125c686-8aa6-4502-bdcc-b6d17ca41a3b-m0.avro",
7989, 0, snapshotID).
AddedFiles(3).
ExistingFiles(0).
@@ -66,7 +66,7 @@ var (
}
manifestFileRecordsV2 = []ManifestFile{
- NewManifestFile(2,
"/home/iceberg/warehouse/nyc/taxis_partitioned/metadata/0125c686-8aa6-4502-bdcc-b6d17ca41a3b-m0.avro",
+ NewManifestBuilder(2,
"/home/iceberg/warehouse/nyc/taxis_partitioned/metadata/0125c686-8aa6-4502-bdcc-b6d17ca41a3b-m0.avro",
7989, 0, snapshotID).
Content(ManifestContentDeletes).
SequenceNum(3, 3).
@@ -85,7 +85,7 @@ var (
}
manifestFileRecordsV3 = []ManifestFile{
- NewManifestFile(3,
"/home/iceberg/warehouse/nyc/taxis_partitioned/metadata/0125c686-8aa6-4502-bdcc-b6d17ca41a3b-m0.avro",
+ NewManifestBuilder(3,
"/home/iceberg/warehouse/nyc/taxis_partitioned/metadata/0125c686-8aa6-4502-bdcc-b6d17ca41a3b-m0.avro",
7989, 0, snapshotID).
Content(ManifestContentData).
SequenceNum(5, 5).
@@ -1803,7 +1803,7 @@ func (m *ManifestTestSuite)
TestReadManifestListIncompleteSchema() {
var buf bytes.Buffer
seqNum := int64(9876)
err := WriteManifestList(2, &buf, 1234, nil, &seqNum, 0, []ManifestFile{
- NewManifestFile(2,
"s3://bucket/namespace/table/metadata/abcd-0123.avro", 99, 0, 1234).Build(),
+ NewManifestBuilder(2,
"s3://bucket/namespace/table/metadata/abcd-0123.avro", 99, 0, 1234).Build(),
})
m.NoError(err)
files, err := ReadManifestList(&buf)
@@ -2623,7 +2623,7 @@ func (m *ManifestTestSuite)
TestManifestBuilderPartitionsCopiesInput() {
UpperBound: &upperBound,
}}
- manifest := NewManifestFile(2, "file.avro", 1, 1,
entrySnapshotID).Partitions(partitions).Build()
+ manifest := NewManifestBuilder(2, "file.avro", 1, 1,
entrySnapshotID).Partitions(partitions).Build()
containsNaN = false
lowerBound[0] = 0x09
@@ -2642,7 +2642,7 @@ func (m *ManifestTestSuite)
TestManifestBuilderPartitionsCopiesInput() {
func (m *ManifestTestSuite) TestManifestBuilderKeyMetadataCopiesInput() {
keyMetadata := []byte{0x00, 0x01, 0x02}
- manifest := NewManifestFile(2, "file.avro", 1, 1,
entrySnapshotID).KeyMetadata(keyMetadata).Build()
+ manifest := NewManifestBuilder(2, "file.avro", 1, 1,
entrySnapshotID).KeyMetadata(keyMetadata).Build()
keyMetadata[1] = 0x09
@@ -2653,7 +2653,7 @@ func (m *ManifestTestSuite)
TestManifestFileGettersReturnDefensiveCopies() {
containsNaN := true
lowerBound := []byte{0x00, 0x01}
upperBound := []byte{0x02, 0x03}
- manifest := NewManifestFile(3, "file.avro", 1, 1, entrySnapshotID).
+ manifest := NewManifestBuilder(3, "file.avro", 1, 1, entrySnapshotID).
Partitions([]FieldSummary{{
ContainsNull: true,
ContainsNaN: &containsNaN,
@@ -2823,7 +2823,7 @@ func (m *ManifestTestSuite)
TestEmptyManifestWriterCloseIsTerminal() {
_, err = writer.ToManifestFile("manifest.avro",
int64(out.Len()))
m.Same(firstErr, err)
- manifest := NewManifestFile(
+ manifest := NewManifestBuilder(
version,
"manifest.avro",
int64(out.Len()),
@@ -3281,9 +3281,9 @@ func (m *ManifestTestSuite)
TestV3ManifestListWriterRowIDTracking() {
m.EqualValues(firstRowID, *writer.NextRowID())
// Create test manifests with row counts
manifests := []ManifestFile{
- NewManifestFile(3, "test1.avro", 100, 1, snapshotID).
+ NewManifestBuilder(3, "test1.avro", 100, 1, snapshotID).
AddedRows(1000).ExistingRows(500).Build(),
- NewManifestFile(3, "test2.avro", 200, 1, snapshotID).
+ NewManifestBuilder(3, "test2.avro", 200, 1, snapshotID).
AddedRows(2000).ExistingRows(300).Build(),
}
// Add manifests - should update nextRowID
@@ -3314,7 +3314,7 @@ func (m *ManifestTestSuite)
TestV3ManifestListWriterRejectsInvalidRowIDRanges()
var buf bytes.Buffer
writer, err := NewManifestListWriterV3(&buf, snapshotID, 1, 0,
nil)
m.Require().NoError(err)
- manifest := NewManifestFile(3, "negative.avro", 100, 1,
snapshotID).AddedRows(-2).Build()
+ manifest := NewManifestBuilder(3, "negative.avro", 100, 1,
snapshotID).AddedRows(-2).Build()
err = writer.AddManifests([]ManifestFile{manifest})
m.Require().ErrorIs(err, ErrInvalidArgument)
m.Require().ErrorContains(err, "row counts must be
non-negative")
@@ -3324,7 +3324,7 @@ func (m *ManifestTestSuite)
TestV3ManifestListWriterRejectsInvalidRowIDRanges()
var buf bytes.Buffer
writer, err := NewManifestListWriterV3(&buf, snapshotID, 1, 0,
nil)
m.Require().NoError(err)
- manifest := NewManifestFile(3, "negative-existing.avro", 100,
1, snapshotID).ExistingRows(-2).Build()
+ manifest := NewManifestBuilder(3, "negative-existing.avro",
100, 1, snapshotID).ExistingRows(-2).Build()
err = writer.AddManifests([]ManifestFile{manifest})
m.Require().ErrorIs(err, ErrInvalidArgument)
m.Require().ErrorContains(err, "row counts must be
non-negative")
@@ -3334,7 +3334,7 @@ func (m *ManifestTestSuite)
TestV3ManifestListWriterRejectsInvalidRowIDRanges()
var buf bytes.Buffer
writer, err := NewManifestListWriterV3(&buf, snapshotID, 1,
math.MaxInt64, nil)
m.Require().NoError(err)
- manifest := NewManifestFile(3, "overflow.avro", 100, 1,
snapshotID).AddedRows(1).Build()
+ manifest := NewManifestBuilder(3, "overflow.avro", 100, 1,
snapshotID).AddedRows(1).Build()
err = writer.AddManifests([]ManifestFile{manifest})
m.Require().ErrorIs(err, ErrInvalidArgument)
m.Require().ErrorContains(err, "overflows int64")
@@ -3345,7 +3345,7 @@ func (m *ManifestTestSuite)
TestV3ManifestListWriterRejectsInvalidRowIDRanges()
var buf bytes.Buffer
writer, err := NewManifestListWriterV3(&buf, snapshotID, 1,
math.MaxInt64, nil)
m.Require().NoError(err)
- manifest := NewManifestFile(3, "overflow-existing.avro", 100,
1, snapshotID).ExistingRows(1).Build()
+ manifest := NewManifestBuilder(3, "overflow-existing.avro",
100, 1, snapshotID).ExistingRows(1).Build()
err = writer.AddManifests([]ManifestFile{manifest})
m.Require().ErrorIs(err, ErrInvalidArgument)
m.Require().ErrorContains(err, "overflows int64")
@@ -3356,7 +3356,7 @@ func (m *ManifestTestSuite)
TestV3ManifestListWriterRejectsInvalidRowIDRanges()
var buf bytes.Buffer
writer, err := NewManifestListWriterV3(&buf, snapshotID, 1, 10,
nil)
m.Require().NoError(err)
- manifest := NewManifestFile(3, "other-snapshot.avro", 100, 1,
snapshotID+1).AddedRows(5).Build()
+ manifest := NewManifestBuilder(3, "other-snapshot.avro", 100,
1, snapshotID+1).AddedRows(5).Build()
err = writer.AddManifests([]ManifestFile{manifest})
m.Require().ErrorContains(err, "unassigned sequence number")
m.EqualValues(10, *writer.NextRowID())
@@ -3368,8 +3368,8 @@ func (m *ManifestTestSuite)
TestV3ManifestListWriterRejectsInvalidRowIDRanges()
writer, err := NewManifestListWriterV3(&buf, snapshotID, 1,
startRowID, nil)
m.Require().NoError(err)
manifests := []ManifestFile{
- NewManifestFile(3, "valid.avro", 100, 1,
snapshotID).AddedRows(5).Build(),
- NewManifestFile(3, "overflow.avro", 100, 1,
snapshotID).AddedRows(1).Build(),
+ NewManifestBuilder(3, "valid.avro", 100, 1,
snapshotID).AddedRows(5).Build(),
+ NewManifestBuilder(3, "overflow.avro", 100, 1,
snapshotID).AddedRows(1).Build(),
}
err = writer.AddManifests(manifests)
m.Require().ErrorContains(err, "overflows int64")
@@ -3387,9 +3387,9 @@ func (m *ManifestTestSuite)
TestV3ManifestListWriterAssignedRowIDDelta() {
writer, err := NewManifestListWriterV3(&buf, commitSnapID, sequenceNum,
firstRowID, nil)
m.Require().NoError(err)
manifests := []ManifestFile{
- NewManifestFile(3, "current.avro", 100, 1,
commitSnapID).AddedRows(10).ExistingRows(5).Build(),
- NewManifestFile(3, "carried.avro", 200, 1,
otherSnapID).SequenceNum(0, 0).AddedRows(100).ExistingRows(50).Build(),
- NewManifestFile(3, "current2.avro", 300, 1,
commitSnapID).AddedRows(20).Build(),
+ NewManifestBuilder(3, "current.avro", 100, 1,
commitSnapID).AddedRows(10).ExistingRows(5).Build(),
+ NewManifestBuilder(3, "carried.avro", 200, 1,
otherSnapID).SequenceNum(0, 0).AddedRows(100).ExistingRows(50).Build(),
+ NewManifestBuilder(3, "current2.avro", 300, 1,
commitSnapID).AddedRows(20).Build(),
}
err = writer.AddManifests(manifests)
m.Require().NoError(err)
@@ -3407,9 +3407,9 @@ func (m *ManifestTestSuite)
TestV3ManifestListWriterDeltaIgnoresNonDataManifests
writer, err := NewManifestListWriterV3(&buf, commitSnapID, sequenceNum,
firstRowID, nil)
m.Require().NoError(err)
manifests := []ManifestFile{
- NewManifestFile(3, "data.avro", 100, 1,
commitSnapID).AddedRows(10).ExistingRows(5).Build(),
- NewManifestFile(3, "deletes.avro", 200, 1,
commitSnapID).Content(ManifestContentDeletes).AddedRows(100).Build(),
- NewManifestFile(3, "data2.avro", 300, 1,
commitSnapID).AddedRows(20).Build(),
+ NewManifestBuilder(3, "data.avro", 100, 1,
commitSnapID).AddedRows(10).ExistingRows(5).Build(),
+ NewManifestBuilder(3, "deletes.avro", 200, 1,
commitSnapID).Content(ManifestContentDeletes).AddedRows(100).Build(),
+ NewManifestBuilder(3, "data2.avro", 300, 1,
commitSnapID).AddedRows(20).Build(),
}
err = writer.AddManifests(manifests)
m.Require().NoError(err)
@@ -3429,8 +3429,8 @@ func (m *ManifestTestSuite)
TestV3ManifestListWriterPersistsPerManifestFirstRowI
m.Require().NoError(err)
manifests := []ManifestFile{
- NewManifestFile(3, "m1.avro", 10, 1,
commitSnapID).AddedRows(10).ExistingRows(5).Build(), // delta = 15
- NewManifestFile(3, "m2.avro", 10, 1,
commitSnapID).AddedRows(7).Build(), // delta = 7
+ NewManifestBuilder(3, "m1.avro", 10, 1,
commitSnapID).AddedRows(10).ExistingRows(5).Build(), // delta = 15
+ NewManifestBuilder(3, "m2.avro", 10, 1,
commitSnapID).AddedRows(7).Build(), // delta = 7
}
m.Require().NoError(writer.AddManifests(manifests))
m.Require().NoError(writer.Close())
@@ -3745,7 +3745,7 @@ func (m *ManifestTestSuite)
TestManifestListWriterPreservesEmptyPartitionArrayWh
seqNum := int64(1)
emptyPartitions := []FieldSummary{}
originalSnapshotID := int64(101)
- original := NewManifestFile(2, "s3://bucket/table/metadata/m0.avro",
100, 0, originalSnapshotID).
+ original := NewManifestBuilder(2, "s3://bucket/table/metadata/m0.avro",
100, 0, originalSnapshotID).
Partitions(emptyPartitions).
AddedFiles(1).
AddedRows(10).
@@ -3764,7 +3764,7 @@ func (m *ManifestTestSuite)
TestManifestListWriterPreservesEmptyPartitionArrayWh
m.Require().Len(inherited, 1)
appendSnapshotID := int64(102)
- newManifest := NewManifestFile(2, "s3://bucket/table/metadata/m1.avro",
50, 0, appendSnapshotID).
+ newManifest := NewManifestBuilder(2,
"s3://bucket/table/metadata/m1.avro", 50, 0, appendSnapshotID).
Partitions(emptyPartitions).
AddedFiles(1).
AddedRows(5).
@@ -3790,7 +3790,7 @@ func (m *ManifestTestSuite)
TestManifestListWriterKeepsAbsentPartitionListNull()
// No Partitions(...) call: PartitionList stays nil (absent).
partitions is
// optional in the manifest-list spec, so an absent value must
round-trip as
// null rather than be normalized into an empty array.
- manifest := NewManifestFile(2, "s3://bucket/table/metadata/m0.avro",
100, 0, snapshotID).
+ manifest := NewManifestBuilder(2, "s3://bucket/table/metadata/m0.avro",
100, 0, snapshotID).
AddedFiles(1).
AddedRows(10).
Build()
@@ -3810,11 +3810,11 @@ func (m *ManifestTestSuite)
TestManifestListV1WriterPartitionListEncoding() {
// Exercise the version-1 encode path (the manifestFileV1 toV1 loop,
distinct
// from the wrapped v2/v3 path): an absent PartitionList must stay null
while
// a present-but-empty one must encode as an empty array.
- absent := NewManifestFile(1, "s3://bucket/table/metadata/m0.avro", 100,
0, snapshotID).
+ absent := NewManifestBuilder(1, "s3://bucket/table/metadata/m0.avro",
100, 0, snapshotID).
AddedFiles(1).
AddedRows(10).
Build()
- emptyPresent := NewManifestFile(1,
"s3://bucket/table/metadata/m1.avro", 100, 0, snapshotID).
+ emptyPresent := NewManifestBuilder(1,
"s3://bucket/table/metadata/m1.avro", 100, 0, snapshotID).
Partitions([]FieldSummary{}).
AddedFiles(1).
AddedRows(5).
@@ -3853,7 +3853,7 @@ func (m *ManifestTestSuite)
TestManifestListWriterPreservesPopulatedPartitionSum
UpperBound: &upper,
}}
- original := NewManifestFile(2, "s3://bucket/table/metadata/m0.avro",
100, 1, originalSnapshotID).
+ original := NewManifestBuilder(2, "s3://bucket/table/metadata/m0.avro",
100, 1, originalSnapshotID).
Partitions(summaries).
AddedFiles(1).
AddedRows(10).
@@ -3868,7 +3868,7 @@ func (m *ManifestTestSuite)
TestManifestListWriterPreservesPopulatedPartitionSum
m.Require().Len(inherited, 1)
appendSnapshotID := int64(402)
- newManifest := NewManifestFile(2, "s3://bucket/table/metadata/m1.avro",
50, 1, appendSnapshotID).
+ newManifest := NewManifestBuilder(2,
"s3://bucket/table/metadata/m1.avro", 50, 1, appendSnapshotID).
Partitions(summaries).
AddedFiles(1).
AddedRows(5).
diff --git a/table/all_manifests_internal_test.go
b/table/all_manifests_internal_test.go
index b413cf270..e7c16f965 100644
--- a/table/all_manifests_internal_test.go
+++ b/table/all_manifests_internal_test.go
@@ -198,7 +198,7 @@ func tableWithManifestListsUsingIO(t *testing.T,
snapshotCount int, readIOFn fun
snapshotID := int64(i + 1)
seqNum := snapshotID
manifestPath := fmt.Sprintf("%s/metadata/manifest-%02d.avro",
tableLocation, snapshotID)
- manifest := iceberg.NewManifestFile(2, manifestPath, 1, 0,
snapshotID).
+ manifest := iceberg.NewManifestBuilder(2, manifestPath, 1, 0,
snapshotID).
SequenceNum(seqNum, seqNum).
AddedFiles(1).
AddedRows(1).
diff --git a/table/evaluator_race_test.go b/table/evaluator_race_test.go
index 4bd4e2965..4753db4a1 100644
--- a/table/evaluator_race_test.go
+++ b/table/evaluator_race_test.go
@@ -59,7 +59,7 @@ func TestManifestEvalVisitorEvalRace(t *testing.T) {
manifests := make([]iceberg.ManifestFile, goroutines)
for i := range manifests {
- manifests[i] = iceberg.NewManifestFile(1, "", 0, 0,
int64(i)).Partitions(
+ manifests[i] = iceberg.NewManifestBuilder(1, "", 0, 0,
int64(i)).Partitions(
[]iceberg.FieldSummary{
{
ContainsNull: false,
diff --git a/table/evaluators_bench_test.go b/table/evaluators_bench_test.go
index e941438ae..7e1db9221 100644
--- a/table/evaluators_bench_test.go
+++ b/table/evaluators_bench_test.go
@@ -41,7 +41,7 @@ func BenchmarkManifestEvaluatorBuiltInPartitions(b
*testing.B) {
summaries :=
manifestEvaluatorBenchmarkSummaries(fieldCount)
manifests := make([]iceberg.ManifestFile,
manifestCount)
for i := range manifests {
- manifests[i] = iceberg.NewManifestFile(
+ manifests[i] =
iceberg.NewManifestBuilder(
2,
fmt.Sprintf("manifest-%d.avro", i), 0, int32(spec.ID()), 1,
).Partitions(summaries).Build()
}
diff --git a/table/evaluators_invalid_bounds_test.go
b/table/evaluators_invalid_bounds_test.go
index bcd121dd6..a79d01d46 100644
--- a/table/evaluators_invalid_bounds_test.go
+++ b/table/evaluators_invalid_bounds_test.go
@@ -38,7 +38,7 @@ func TestMalformedFixedBoundsAreConservative(t *testing.T) {
eval, err := newManifestEvaluator(spec, schema, expr, true)
require.NoError(t, err)
- manifest := iceberg.NewManifestFile(2, "manifest.avro", 1, 0,
1).
+ manifest := iceberg.NewManifestBuilder(2, "manifest.avro", 1,
0, 1).
AddedFiles(1).
Partitions([]iceberg.FieldSummary{{LowerBound:
&malformed, UpperBound: &malformed}}).
Build()
diff --git a/table/evaluators_test.go b/table/evaluators_test.go
index 03c2ae56a..0294d885f 100644
--- a/table/evaluators_test.go
+++ b/table/evaluators_test.go
@@ -137,8 +137,8 @@ func TestManifestEvaluator(t *testing.T) {
}
spec := iceberg.NewPartitionSpec(partFields...)
- manifestNoStats := iceberg.NewManifestFile(1, "", 0, 0, 0).Build()
- manifest := iceberg.NewManifestFile(1, "", 0, 0, 0).Partitions(
+ manifestNoStats := iceberg.NewManifestBuilder(1, "", 0, 0, 0).Build()
+ manifest := iceberg.NewManifestBuilder(1, "", 0, 0, 0).Partitions(
[]iceberg.FieldSummary{
{ // id
ContainsNull: false,
@@ -759,7 +759,7 @@ func TestManifestEvaluatorWithDroppedPartitionSource(t
*testing.T) {
return iceberg.FieldSummary{ContainsNull: false, LowerBound:
&lower, UpperBound: &upper}
}
manifestWith := func(summaries ...iceberg.FieldSummary)
iceberg.ManifestFile {
- return iceberg.NewManifestFile(1, "", 0, 0,
0).Partitions(summaries).Build()
+ return iceberg.NewManifestBuilder(1, "", 0, 0,
0).Partitions(summaries).Build()
}
// evalForCol projects (col == 2) onto the spec and returns the manifest
// evaluator. In every case below the dropped field's slot contains 2
diff --git a/table/in_predicate_extrema_bench_test.go
b/table/in_predicate_extrema_bench_test.go
index 81a3c6a4f..0cfe2da9d 100644
--- a/table/in_predicate_extrema_bench_test.go
+++ b/table/in_predicate_extrema_bench_test.go
@@ -102,7 +102,7 @@ func benchmarkManifestIn[T iceberg.LiteralType](b
*testing.B, values []T, lower,
if err != nil {
b.Fatal(err)
}
- manifest := iceberg.NewManifestFile(2, "manifest.avro", 1, 0,
1).Partitions(
+ manifest := iceberg.NewManifestBuilder(2, "manifest.avro", 1, 0,
1).Partitions(
[]iceberg.FieldSummary{{LowerBound: &lowerBytes, UpperBound:
&upperBytes}},
).Build()
diff --git a/table/in_predicate_extrema_test.go
b/table/in_predicate_extrema_test.go
index 663293eda..59397deaf 100644
--- a/table/in_predicate_extrema_test.go
+++ b/table/in_predicate_extrema_test.go
@@ -170,7 +170,7 @@ func TestManifestEvaluatorInPredicateExtrema(t *testing.T) {
require.NoError(t, err)
upper, err := tt.upper.MarshalBinary()
require.NoError(t, err)
- manifest := iceberg.NewManifestFile(2, "manifest.avro",
1, 0, 1).Partitions(
+ manifest := iceberg.NewManifestBuilder(2,
"manifest.avro", 1, 0, 1).Partitions(
[]iceberg.FieldSummary{{LowerBound: &lower,
UpperBound: &upper}},
).Build()
diff --git a/table/inspect_internal_test.go b/table/inspect_internal_test.go
index 3da07bd0e..d7d3da7a0 100644
--- a/table/inspect_internal_test.go
+++ b/table/inspect_internal_test.go
@@ -1197,7 +1197,7 @@ func TestInspectAllManifestsPreservesSnapshotReferences(t
*testing.T) {
builder, err := MetadataBuilderFromBase(meta, "")
require.NoError(t, err)
- manifest := iceberg.NewManifestFile(2,
tableLocation+"/metadata/shared-manifest.avro", 100, 0, 1).
+ manifest := iceberg.NewManifestBuilder(2,
tableLocation+"/metadata/shared-manifest.avro", 100, 0, 1).
SequenceNum(1, 1).
AddedFiles(1).
KeyMetadata([]byte{1, 2, 3}).
@@ -1248,7 +1248,7 @@ func TestInspectAllManifestsStreamsRecordBatches(t
*testing.T) {
manifests := make([]iceberg.ManifestFile, manifestCount)
for idx := range manifests {
- manifests[idx] = iceberg.NewManifestFile(2,
+ manifests[idx] = iceberg.NewManifestBuilder(2,
fmt.Sprintf("mem://default/table-location/metadata/manifest-%04d.avro", idx),
100, 0, 1).
SequenceNum(1, 1).
@@ -1284,7 +1284,7 @@ func TestInspectAllManifestsAllocator(t *testing.T) {
manifests := make([]iceberg.ManifestFile,
tt.manifestCount)
for idx := range manifests {
- manifests[idx] = iceberg.NewManifestFile(2,
+ manifests[idx] = iceberg.NewManifestBuilder(2,
fmt.Sprintf("mem://default/table-location/metadata/manifest-%04d.avro", idx),
100, 0, 1).
SequenceNum(1, 1).
@@ -1368,7 +1368,7 @@ func TestInspectManifestsContainsNaN(t *testing.T) {
containsNaN := true
bound, err := iceberg.Int32Literal(7).MarshalBinary()
require.NoError(t, err)
- manifest := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/contains-nan.avro",
+ manifest := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/contains-nan.avro",
100, int32(spec.ID()), 1).
SequenceNum(1, 1).
Partitions([]iceberg.FieldSummary{{
@@ -1427,7 +1427,7 @@ func TestInspectManifestsPromotedPartitionSummaryBounds(t
*testing.T) {
})
bound, err := tt.literal.MarshalBinary()
require.NoError(t, err)
- manifest := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/promoted.avro",
+ manifest := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/promoted.avro",
100, int32(spec.ID()), 1).
SequenceNum(1, 1).
Partitions([]iceberg.FieldSummary{{LowerBound:
&bound, UpperBound: &bound}}).
@@ -1457,7 +1457,7 @@ func TestInspectManifestsDroppedPartitionSource(t
*testing.T) {
currentSchema := iceberg.NewSchema(1)
bound, err := iceberg.Int32Literal(7).MarshalBinary()
require.NoError(t, err)
- manifest := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/dropped-source.avro",
+ manifest := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/dropped-source.avro",
100, int32(spec.ID()), 1).
SequenceNum(1, 1).
Partitions([]iceberg.FieldSummary{{LowerBound: &bound,
UpperBound: &bound}}).
@@ -1481,7 +1481,7 @@ func TestInspectManifestsDroppedPartitionSource(t
*testing.T) {
func TestInspectManifestsDeleteCounts(t *testing.T) {
spec := partitionedSpec()
- manifest := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/delete-manifest.avro",
+ manifest := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/delete-manifest.avro",
100, int32(spec.ID()), 1).
Content(iceberg.ManifestContentDeletes).
SequenceNum(1, 1).
@@ -1508,7 +1508,7 @@ func TestInspectManifestsDeleteCounts(t *testing.T) {
func TestInspectManifestsV1UnknownCounts(t *testing.T) {
spec := partitionedSpec()
- manifest := iceberg.NewManifestFile(1,
"mem://default/table-location/metadata/v1-manifest.avro",
+ manifest := iceberg.NewManifestBuilder(1,
"mem://default/table-location/metadata/v1-manifest.avro",
100, int32(spec.ID()), 1).
AddedFiles(-1).
ExistingFiles(-1).
@@ -1578,7 +1578,7 @@ func TestAppendManifestCountValidatesNegativeSentinels(t
*testing.T) {
func TestInspectManifestsRejectsNegativeAddedSnapshotID(t *testing.T) {
spec := partitionedSpec()
- manifest := iceberg.NewManifestFile(1,
"mem://default/table-location/metadata/v1-manifest.avro",
+ manifest := iceberg.NewManifestBuilder(1,
"mem://default/table-location/metadata/v1-manifest.avro",
100, int32(spec.ID()), -1).
Build()
tbl := inspectTableWithManifestList(t, spec, 1,
[]iceberg.ManifestFile{manifest})
@@ -1612,7 +1612,7 @@ func
TestInspectManifestsRejectsNegativeCountsForV2AndV3(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
spec := partitionedSpec()
- manifest := iceberg.NewManifestFile(tt.version,
"mem://default/table-location/metadata/negative-count.avro",
+ manifest := iceberg.NewManifestBuilder(tt.version,
"mem://default/table-location/metadata/negative-count.avro",
100, int32(spec.ID()), 1).
Content(tt.content).
SequenceNum(1, 1).
@@ -1631,7 +1631,7 @@ func
TestInspectManifestsRejectsNegativeCountsForV2AndV3(t *testing.T) {
func TestInspectManifestsRejectsMissingPartitionSpec(t *testing.T) {
spec := partitionedSpec()
- manifest := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/missing-spec.avro",
+ manifest := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/missing-spec.avro",
100, 999, 1).
SequenceNum(1, 1).
Partitions([]iceberg.FieldSummary{{}}).
@@ -1645,7 +1645,7 @@ func TestInspectManifestsRejectsMissingPartitionSpec(t
*testing.T) {
func TestInspectManifestsAllowsMissingPartitionSpecWithoutSummaries(t
*testing.T) {
spec := partitionedSpec()
- manifest := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/missing-spec.avro",
+ manifest := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/missing-spec.avro",
100, 999, 1).
SequenceNum(1, 1).
Build()
@@ -1666,7 +1666,7 @@ func
TestInspectManifestsAllowsMissingPartitionSpecWithoutSummaries(t *testing.T
func TestInspectManifestsReportsPartitionFieldNameInBoundErrors(t *testing.T) {
spec := partitionedSpec()
invalidBound := []byte{0x01}
- manifest := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/invalid-bound.avro",
+ manifest := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/invalid-bound.avro",
100, int32(spec.ID()), 1).
SequenceNum(1, 1).
Partitions([]iceberg.FieldSummary{{LowerBound: &invalidBound}}).
@@ -1679,7 +1679,7 @@ func
TestInspectManifestsReportsPartitionFieldNameInBoundErrors(t *testing.T) {
func TestInspectManifestsWrapsFileIOFactoryError(t *testing.T) {
spec := partitionedSpec()
- manifest := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/manifest.avro",
+ manifest := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/manifest.avro",
100, int32(spec.ID()), 1).
SequenceNum(1, 1).
Build()
@@ -1710,7 +1710,7 @@ func TestInspectManifestsNoCurrentSnapshot(t *testing.T) {
func TestInspectManifestsRejectsExtraPartitionSummaries(t *testing.T) {
spec := partitionedSpec()
- manifest := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/extra-summary.avro",
+ manifest := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/extra-summary.avro",
100, int32(spec.ID()), 1).
SequenceNum(1, 1).
Partitions([]iceberg.FieldSummary{{}, {}}).
@@ -1724,7 +1724,7 @@ func TestInspectManifestsRejectsExtraPartitionSummaries(t
*testing.T) {
func TestInspectManifestsRejectsUnknownContent(t *testing.T) {
spec := partitionedSpec()
- manifest := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/unknown-content.avro",
+ manifest := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/unknown-content.avro",
100, int32(spec.ID()), 1).
Content(iceberg.ManifestContent(2)).
SequenceNum(1, 1).
@@ -2866,7 +2866,7 @@ func
TestInspectPartitionsLeavesSpecIDUnsetForExpiredSnapshot(t *testing.T) {
iceberg.EntryStatusADDED, new(expiredSnapshotID),
&sequenceNumber, &sequenceNumber, file)})
require.NoError(t, err)
require.NoError(t, memIO.WriteFile(manifestPath, manifestBuf.Bytes()))
- manifest := iceberg.NewManifestFile(2, manifestPath,
int64(manifestBuf.Len()), int32(spec.ID()), expiredSnapshotID).
+ manifest := iceberg.NewManifestBuilder(2, manifestPath,
int64(manifestBuf.Len()), int32(spec.ID()), expiredSnapshotID).
SequenceNum(sequenceNumber, sequenceNumber).
AddedFiles(1).
AddedRows(1).
@@ -3237,7 +3237,7 @@ func TestInspectPositionDeletesDefersLaterManifestReads(t
*testing.T) {
newPosDeleteFile(t, deletePath, inspectRecordBatchSize,
128),
)},
)
- missingManifest := iceberg.NewManifestFile(
+ missingManifest := iceberg.NewManifestBuilder(
2, "mem://position-deletes/table/metadata/not-opened.avro", 1,
0, snapshotID,
).Content(iceberg.ManifestContentDeletes).AddedFiles(1).ExistingFiles(0).DeletedFiles(0).Build()
tbl := inspectPositionDeletesTableWithManifests(
diff --git a/table/inspect_snapshot_prefetch_test.go
b/table/inspect_snapshot_prefetch_test.go
index 990a60493..bb61abc10 100644
--- a/table/inspect_snapshot_prefetch_test.go
+++ b/table/inspect_snapshot_prefetch_test.go
@@ -71,7 +71,7 @@ func
TestInspectSnapshotManifestPrefetchPreservesOrderAndBoundsReads(t *testing.
}
path := fmt.Sprintf("manifest-%d.avro",
snapshot.SnapshotID)
- manifest := iceberg.NewManifestFile(2, path,
10, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, path,
10, 0, 1).Build()
return snapshotManifestSet{all:
[]iceberg.ManifestFile{manifest}}, nil
},
@@ -124,7 +124,7 @@ func TestInspectSnapshotManifestPrefetchUsesCachedSets(t
*testing.T) {
snapshots[i].SnapshotID = int64(i + 1)
if i%2 == 0 {
path := fmt.Sprintf("manifest-%d.avro", i+1)
- manifest := iceberg.NewManifestFile(2, path, 10, 0,
1).Build()
+ manifest := iceberg.NewManifestBuilder(2, path, 10, 0,
1).Build()
cachedSets[int64(i+1)] = snapshotManifestSet{all:
[]iceberg.ManifestFile{manifest}}
}
}
@@ -140,7 +140,7 @@ func TestInspectSnapshotManifestPrefetchUsesCachedSets(t
*testing.T) {
func(_ context.Context, snapshot Snapshot)
(snapshotManifestSet, error) {
loaded.Add(1)
path := fmt.Sprintf("manifest-%d.avro",
snapshot.SnapshotID)
- manifest := iceberg.NewManifestFile(2, path, 10, 0,
1).Build()
+ manifest := iceberg.NewManifestBuilder(2, path, 10, 0,
1).Build()
return snapshotManifestSet{all:
[]iceberg.ManifestFile{manifest}}, nil
},
@@ -166,7 +166,7 @@ func TestInspectSnapshotManifestPrefetchDeduplicatesPaths(t
*testing.T) {
func(_ context.Context, snapshot Snapshot)
(snapshotManifestSet, error) {
set := snapshotManifestSet{}
for _, path := range manifests[snapshot.SnapshotID-1] {
- set.all = append(set.all,
iceberg.NewManifestFile(2, path, 10, 0, 1).Build())
+ set.all = append(set.all,
iceberg.NewManifestBuilder(2, path, 10, 0, 1).Build())
}
return set, nil
@@ -195,7 +195,7 @@ func
TestInspectSnapshotManifestPrefetchStopsReadersOnEarlyExit(t *testing.T) {
defer active.Add(-1)
if snapshot.SnapshotID == 1 {
- manifest := iceberg.NewManifestFile(2,
"first.avro", 10, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2,
"first.avro", 10, 0, 1).Build()
return snapshotManifestSet{all:
[]iceberg.ManifestFile{manifest}}, nil
}
@@ -224,7 +224,7 @@ func
TestInspectSnapshotManifestPrefetchReportsFirstOrderedError(t *testing.T) {
return snapshotManifestSet{}, failure
}
path := fmt.Sprintf("manifest-%d.avro",
snapshot.SnapshotID)
- manifest := iceberg.NewManifestFile(2, path, 10, 0,
1).Build()
+ manifest := iceberg.NewManifestBuilder(2, path, 10, 0,
1).Build()
return snapshotManifestSet{all:
[]iceberg.ManifestFile{manifest}}, nil
},
@@ -298,7 +298,7 @@ func BenchmarkInspectSnapshotManifestListCacheHit(b
*testing.B) {
sets := make([]snapshotManifestSet, count)
for i := range snapshots {
snapshots[i].SnapshotID = int64(i + 1)
- manifest := iceberg.NewManifestFile(2,
fmt.Sprintf("manifest-%d.avro", i+1), 10, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2,
fmt.Sprintf("manifest-%d.avro", i+1), 10, 0, 1).Build()
sets[i] = snapshotManifestSet{all:
[]iceberg.ManifestFile{manifest}}
_, err := cache.get(context.Background(),
snapshots[i], func(context.Context) (snapshotManifestSet, error) {
return sets[i], nil
diff --git a/table/maintenance/manifest_test_helpers_test.go
b/table/maintenance/manifest_test_helpers_test.go
index 4c02d9fca..d84f913da 100644
--- a/table/maintenance/manifest_test_helpers_test.go
+++ b/table/maintenance/manifest_test_helpers_test.go
@@ -135,7 +135,7 @@ func writeManifest(t testing.TB, tio *trackingIO,
snapshotID, seqNum int64, mani
require.NoError(t, err)
require.NoError(t, tio.WriteFile(manifestPath, buf.Bytes()))
- return iceberg.NewManifestFile(2, manifestPath, int64(buf.Len()), 0,
snapshotID).
+ return iceberg.NewManifestBuilder(2, manifestPath, int64(buf.Len()), 0,
snapshotID).
SequenceNum(seqNum, seqNum).
AddedFiles(1).
AddedRows(1).
diff --git a/table/manifest_content_cache_internal_test.go
b/table/manifest_content_cache_internal_test.go
index a4fd5189d..68430b9f2 100644
--- a/table/manifest_content_cache_internal_test.go
+++ b/table/manifest_content_cache_internal_test.go
@@ -109,7 +109,7 @@ func
TestManifestContentCacheBoundsPopulationAndPreservesFullReads(t *testing.T)
require.NoError(t, base.WriteFile(location, content))
fs := &manifestContentCountingIO{IO: base}
cache := newManifestContentCache(0, 128, 64)
- manifest := iceberg.NewManifestFile(2, location,
tt.expectedLength, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, location,
tt.expectedLength, 0, 1).Build()
file, err := cache.open(t.Context(), fs, manifest)
require.NoError(t, err)
@@ -172,9 +172,9 @@ func TestManifestContentCacheEvictsLeastRecentlyUsed(t
*testing.T) {
require.NoError(t, fs.WriteFile(secondPath, secondBytes))
require.NoError(t, fs.WriteFile(thirdPath, []byte("cccc")))
- first := iceberg.NewManifestFile(2, firstPath, int64(len(firstBytes)),
0, 1).Build()
- second := iceberg.NewManifestFile(2, secondPath,
int64(len(secondBytes)), 0, 1).Build()
- third := iceberg.NewManifestFile(2, thirdPath, 4, 0, 1).Build()
+ first := iceberg.NewManifestBuilder(2, firstPath,
int64(len(firstBytes)), 0, 1).Build()
+ second := iceberg.NewManifestBuilder(2, secondPath,
int64(len(secondBytes)), 0, 1).Build()
+ third := iceberg.NewManifestBuilder(2, thirdPath, 4, 0, 1).Build()
cache := newManifestContentCache(0, 8, 4)
readCachedManifest(t, cache, fs, first)
@@ -193,7 +193,7 @@ func TestManifestContentCacheExpiresIdleEntries(t
*testing.T) {
const location = "mem://manifest-content-cache/expired.avro"
fs := newTrackingCallsIO()
require.NoError(t, fs.WriteFile(location, []byte("aaaa")))
- manifest := iceberg.NewManifestFile(2, location, 4, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, location, 4, 0, 1).Build()
cache := newManifestContentCache(60_000, 8, 4)
now := time.Now()
@@ -223,7 +223,7 @@ func
TestManifestContentCacheZeroExpirationKeepsWarmEntries(t *testing.T) {
now := time.Now()
cache.now = func() time.Time { return now }
- manifest := iceberg.NewManifestFile(2, location, int64(len(content)),
0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, location,
int64(len(content)), 0, 1).Build()
readCachedManifest(t, cache, fs, manifest)
now = now.Add(72 * time.Hour)
readCachedManifest(t, cache, fs, manifest)
@@ -256,7 +256,7 @@ func TestManifestContentCacheSharesInFlightRead(t
*testing.T) {
var release sync.Once
t.Cleanup(func() { release.Do(func() { close(fs.release) }) })
- manifest := iceberg.NewManifestFile(2, manifestPath,
int64(len(content)), 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, manifestPath,
int64(len(content)), 0, 1).Build()
cache := newManifestContentCache(0, 1<<20, 1<<20)
const callers = 16
errs := make(chan error, callers)
@@ -339,8 +339,8 @@ func TestManifestContentCacheInFlightLengthMismatch(t
*testing.T) {
t.Cleanup(func() { release.Do(func() { close(fs.release) }) })
cache := newManifestContentCache(0, 1024, 1024)
- actual := iceberg.NewManifestFile(2, location, int64(len(content)), 0,
1).Build()
- wrongLength := iceberg.NewManifestFile(2, location,
int64(len(content)-1), 0, 1).Build()
+ actual := iceberg.NewManifestBuilder(2, location, int64(len(content)),
0, 1).Build()
+ wrongLength := iceberg.NewManifestBuilder(2, location,
int64(len(content)-1), 0, 1).Build()
type result struct {
content []byte
err error
@@ -524,7 +524,7 @@ func
TestManifestContentCacheFailedPopulationFallsBackWithoutCaching(t *testing.
require.NoError(t, base.WriteFile(location, []byte("test")))
fs := &manifestContentCacheFailOnceIO{IO: base}
cache := newManifestContentCache(0, 16, 16)
- manifest := iceberg.NewManifestFile(2, location, 4, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, location, 4, 0, 1).Build()
readCachedManifest(t, cache, fs, manifest)
assert.Empty(t, cache.entries, "ordinary-open fallback must not
populate the cache")
@@ -549,7 +549,7 @@ func
TestManifestContentCachePreservesPopulationAndFallbackErrors(t *testing.T)
openErrors: []error{io.ErrUnexpectedEOF, io.ErrClosedPipe},
}
cache := newManifestContentCache(0, 16, 16)
- manifest := iceberg.NewManifestFile(2,
"mem://manifest-content-cache/errors.avro", 4, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2,
"mem://manifest-content-cache/errors.avro", 4, 0, 1).Build()
file, err := cache.open(t.Context(), fs, manifest)
assert.Nil(t, file)
@@ -571,7 +571,7 @@ func (manifestContentCachePanicIO) Open(context.Context,
string) (iceio.File, er
func TestManifestContentCachePanicReleasesInFlightLoad(t *testing.T) {
cache := newManifestContentCache(0, 16, 16)
const location = "mem://manifest-content-cache/panic.avro"
- manifest := iceberg.NewManifestFile(2, location, 4, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, location, 4, 0, 1).Build()
assert.Panics(t, func() {
_, _ = cache.open(t.Context(), manifestContentCachePanicIO{},
manifest)
})
@@ -633,12 +633,12 @@ func
TestManifestContentCacheReclaimsExpiredEntriesOnInsert(t *testing.T) {
now := time.Now()
cache.now = func() time.Time { return now }
for _, name := range []string{firstPath, secondPath} {
- readCachedManifest(t, cache, fs, iceberg.NewManifestFile(2,
name, 4, 0, 1).Build())
+ readCachedManifest(t, cache, fs, iceberg.NewManifestBuilder(2,
name, 4, 0, 1).Build())
}
require.Equal(t, int64(8), cache.totalBytes)
now = now.Add(2 * time.Second)
- readCachedManifest(t, cache, fs, iceberg.NewManifestFile(2, thirdPath,
4, 0, 1).Build())
+ readCachedManifest(t, cache, fs, iceberg.NewManifestBuilder(2,
thirdPath, 4, 0, 1).Build())
assert.NotContains(t, cache.entries, firstPath)
assert.NotContains(t, cache.entries, secondPath)
assert.Contains(t, cache.entries, thirdPath)
@@ -701,7 +701,7 @@ func
TestManifestContentCacheFailedSharedLoadFallsBackForAllCallers(t *testing.T
var release sync.Once
t.Cleanup(func() { release.Do(func() {
close(fs.release) }) })
cache := newManifestContentCache(0, 16, 16)
- manifest := iceberg.NewManifestFile(2, path,
tc.expectedLength, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, path,
tc.expectedLength, 0, 1).Build()
producerErr := make(chan error, 1)
go func() {
@@ -775,7 +775,7 @@ func
TestManifestContentCachePanickingProducerUnblocksWaiter(t *testing.T) {
var release sync.Once
t.Cleanup(func() { release.Do(func() { close(fs.release) }) })
cache := newManifestContentCache(0, 16, 16)
- manifest := iceberg.NewManifestFile(2, location, 4, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, location, 4, 0, 1).Build()
producerPanic := make(chan any, 1)
go func() {
@@ -838,7 +838,7 @@ func
TestManifestContentCacheFailedSharedLoadPreservesBothErrors(t *testing.T) {
var release sync.Once
t.Cleanup(func() { release.Do(func() { close(fs.release) }) })
cache := newManifestContentCache(0, 16, 16)
- manifest := iceberg.NewManifestFile(2, location, 4, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, location, 4, 0, 1).Build()
producerErr := make(chan error, 1)
go func() {
@@ -904,7 +904,7 @@ func
TestManifestContentCacheRetriesAfterProducerCancellation(t *testing.T) {
var release sync.Once
t.Cleanup(func() { release.Do(func() { close(fs.release) }) })
cache := newManifestContentCache(0, 16, 16)
- manifest := iceberg.NewManifestFile(2, path, 4, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, path, 4, 0, 1).Build()
ctx, cancel := context.WithCancel(t.Context())
defer cancel()
diff --git a/table/manifest_file_ref_test.go b/table/manifest_file_ref_test.go
index 6a19d8b78..d2c31af0d 100644
--- a/table/manifest_file_ref_test.go
+++ b/table/manifest_file_ref_test.go
@@ -41,7 +41,7 @@ func TestManifestFilePartitionsUsesBorrowedView(t *testing.T)
{
containsNaN := false
lower := []byte{1, 2}
upper := []byte{3, 4}
- manifest := iceberg.NewManifestFile(2, "manifest.avro", 0, 1,
1).Partitions(
+ manifest := iceberg.NewManifestBuilder(2, "manifest.avro", 0, 1,
1).Partitions(
[]iceberg.FieldSummary{{
ContainsNaN: &containsNaN,
LowerBound: &lower,
@@ -70,7 +70,7 @@ func TestManifestFilePartitionsUsesBorrowedView(t *testing.T)
{
}
func TestManifestFilePartitionsFallsBackToPublicGetter(t *testing.T) {
- manifest := iceberg.NewManifestFile(2, "manifest.avro", 0, 1, 1).
+ manifest := iceberg.NewManifestBuilder(2, "manifest.avro", 0, 1, 1).
Partitions([]iceberg.FieldSummary{{}}).Build()
file := &publicManifestFile{ManifestFile: manifest}
diff --git a/table/rewrite_manifests_internal_test.go
b/table/rewrite_manifests_internal_test.go
index ea054a094..65f60b4b4 100644
--- a/table/rewrite_manifests_internal_test.go
+++ b/table/rewrite_manifests_internal_test.go
@@ -78,7 +78,7 @@ func
TestManifestActiveFilesCountsEntriesWhenHeaderCountsAbsent(t *testing.T) {
// A manifest reporting unknown (-1) added/existing counts, as a
manifest
// written without the count fields would (V1's toFile maps absent
counts to
// -1), but pointing at the real file so the fallback has entries to
read.
- unknown := iceberg.NewManifestFile(2, path, length, 0, 1).
+ unknown := iceberg.NewManifestBuilder(2, path, length, 0, 1).
AddedFiles(-1).ExistingFiles(-1).DeletedFiles(-1).Build()
require.EqualValues(t, -1, unknown.AddedDataFiles(), "precondition:
counts must read as unknown")
@@ -87,7 +87,7 @@ func
TestManifestActiveFilesCountsEntriesWhenHeaderCountsAbsent(t *testing.T) {
require.EqualValues(t, n, got, "fallback must count the live entries,
not skip the manifest")
// And the header-count path still wins when the counts are present.
- known := iceberg.NewManifestFile(2, path, length, 0, 1).
+ known := iceberg.NewManifestBuilder(2, path, length, 0, 1).
AddedFiles(n).ExistingFiles(0).DeletedFiles(0).Build()
got, err = manifestActiveFiles(fs, []iceberg.ManifestFile{known})
require.NoError(t, err)
@@ -194,7 +194,7 @@ func TestRewriteManifestsCleansOrphanOnValidationError(t
*testing.T) {
// A header count that lies: the merge re-counts the one real
entry and
// disagrees, tripping the file-count guard after the merged
file is
// already on disk.
- inputs[i] = iceberg.NewManifestFile(2, path, int64(buf.Len()),
int32(spec.ID()), prod.snapshotID).
+ inputs[i] = iceberg.NewManifestBuilder(2, path,
int64(buf.Len()), int32(spec.ID()), prod.snapshotID).
AddedFiles(99).Content(iceberg.ManifestContentData).Build()
}
@@ -367,7 +367,7 @@ func TestRewriteManifestsCleansOrphansOnMergeFailure(t
*testing.T) {
require.NoError(t, err)
require.NoError(t, mem.WriteFile(path, buf.Bytes()))
- inputs[i] = iceberg.NewManifestFile(2, path, int64(buf.Len()),
int32(spec.ID()), prod.snapshotID).
+ inputs[i] = iceberg.NewManifestBuilder(2, path,
int64(buf.Len()), int32(spec.ID()), prod.snapshotID).
AddedFiles(1).Content(iceberg.ManifestContentData).Build()
maxLen = max(maxLen, int64(buf.Len()))
}
diff --git a/table/scan_task_finalization_planfiles_bench_test.go
b/table/scan_task_finalization_planfiles_bench_test.go
index c75178317..8fc19eeaf 100644
--- a/table/scan_task_finalization_planfiles_bench_test.go
+++ b/table/scan_task_finalization_planfiles_bench_test.go
@@ -149,7 +149,7 @@ func newPlanFilesFinalizationBenchmarkTable(b testing.TB,
splitOffsets bool) *Ta
if err := fs.WriteFile(manifestPath, manifestBuffer.Bytes());
err != nil {
b.Fatal(err)
}
- manifests[manifestIndex] = iceberg.NewManifestFile(
+ manifests[manifestIndex] = iceberg.NewManifestBuilder(
2, manifestPath, int64(manifestBuffer.Len()),
int32(manifestSpec.ID()), snapshotID,
).SequenceNum(sequenceNum, sequenceNum).
AddedFiles(int32(planFilesFinalizationBenchmarkFilesPerManifest)).
diff --git a/table/scanner_internal_test.go b/table/scanner_internal_test.go
index d07c3008a..92580d549 100644
--- a/table/scanner_internal_test.go
+++ b/table/scanner_internal_test.go
@@ -44,14 +44,14 @@ import (
)
func newDataManifest(minSeqNum int64) iceberg.ManifestFile {
- return iceberg.NewManifestFile(2, "/path/to/manifest.avro", 1000, 0, 1).
+ return iceberg.NewManifestBuilder(2, "/path/to/manifest.avro", 1000, 0,
1).
Content(iceberg.ManifestContentData).
SequenceNum(minSeqNum, minSeqNum).
Build()
}
func newDeleteManifest(minSeqNum int64) iceberg.ManifestFile {
- return iceberg.NewManifestFile(2, "/path/to/manifest.avro", 1000, 0, 1).
+ return iceberg.NewManifestBuilder(2, "/path/to/manifest.avro", 1000, 0,
1).
Content(iceberg.ManifestContentDeletes).
SequenceNum(minSeqNum, minSeqNum).
Build()
@@ -945,7 +945,7 @@ func TestPlanDataManifestTasksPreservesManifestOrder(t
*testing.T) {
assert.Equal(t, "mem://streamed-planning/data-a.parquet",
tasks[0].File.FilePath())
assert.Equal(t, "mem://streamed-planning/data-b.parquet",
tasks[1].File.FilePath())
- unknownCounts := iceberg.NewManifestFile(
+ unknownCounts := iceberg.NewManifestBuilder(
2, manifests[0].FilePath(), manifests[0].Length(), 0,
snapshotID,
).
SequenceNum(1, 1).
@@ -1098,7 +1098,7 @@ func
TestFetchPartitionSpecFilteredManifests_PropagatesEvalError(t *testing.T) {
// Invalid int32 bounds trigger a LiteralFromBytes error during
manifest eval.
badBounds := []byte{0x00, 0x01}
- mf := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/manifest.avro", 100, int32(spec.ID()),
snapshotID).
+ mf := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/manifest.avro", 100, int32(spec.ID()),
snapshotID).
Partitions([]iceberg.FieldSummary{
{LowerBound: &badBounds, UpperBound: &badBounds,
ContainsNull: false},
}).Build()
@@ -1147,7 +1147,7 @@ func
TestFetchPartitionSpecFilteredManifests_InvalidSpecIDDoesNotPanic(t *testin
manifestListPath =
"mem://default/table-location/metadata/snap-1-manifest-list.avro"
)
- mf := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/manifest.avro", 100, 999,
snapshotID).Build()
+ mf := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/manifest.avro", 100, 999,
snapshotID).Build()
var listBuf bytes.Buffer
seqNum := int64(1)
@@ -1208,17 +1208,17 @@ func TestFetchManifestCountersWithRealSnapshot(t
*testing.T) {
)
specID := int32(spec.ID())
- dataScanned := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/data-scanned.avro", 100, specID,
snapshotID).
+ dataScanned := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/data-scanned.avro", 100, specID,
snapshotID).
Content(iceberg.ManifestContentData).
AddedFiles(1).
Partitions([]iceberg.FieldSummary{{ContainsNull: false,
LowerBound: match, UpperBound: match}}).
Build()
- dataSkipped := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/data-skipped.avro", 100, specID,
snapshotID).
+ dataSkipped := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/data-skipped.avro", 100, specID,
snapshotID).
Content(iceberg.ManifestContentData).
AddedFiles(1).
Partitions([]iceberg.FieldSummary{{ContainsNull: false,
LowerBound: noMatch, UpperBound: noMatch}}).
Build()
- deleteScanned := iceberg.NewManifestFile(2,
"mem://default/table-location/metadata/delete-scanned.avro", 100, specID,
snapshotID).
+ deleteScanned := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/delete-scanned.avro", 100, specID,
snapshotID).
Content(iceberg.ManifestContentDeletes).
SequenceNum(1, 1).
AddedFiles(1).
@@ -1289,24 +1289,24 @@ func
TestFilterManifestsWithSchemaSkipsKnownEmptyManifests(t *testing.T) {
rowFilter: iceberg.AlwaysTrue{},
caseSensitive: true,
}
- knownEmptyData := iceberg.NewManifestFile(2, "data-empty.avro", 100, 0,
1).
+ knownEmptyData := iceberg.NewManifestBuilder(2, "data-empty.avro", 100,
0, 1).
Content(iceberg.ManifestContentData).
AddedFiles(0).
ExistingFiles(0).
DeletedFiles(2).
Build()
- knownEmptyDelete := iceberg.NewManifestFile(2, "delete-empty.avro",
100, 0, 1).
+ knownEmptyDelete := iceberg.NewManifestBuilder(2, "delete-empty.avro",
100, 0, 1).
Content(iceberg.ManifestContentDeletes).
AddedFiles(0).
ExistingFiles(0).
DeletedFiles(1).
Build()
- unknownCounts := iceberg.NewManifestFile(2, "data-unknown.avro", 100,
0, 1).
+ unknownCounts := iceberg.NewManifestBuilder(2, "data-unknown.avro",
100, 0, 1).
Content(iceberg.ManifestContentData).
AddedFiles(-1).
ExistingFiles(-1).
Build()
- live := iceberg.NewManifestFile(2, "data-live.avro", 100, 0, 1).
+ live := iceberg.NewManifestBuilder(2, "data-live.avro", 100, 0, 1).
Content(iceberg.ManifestContentData).
AddedFiles(0).
ExistingFiles(1).
@@ -1351,14 +1351,14 @@ func
TestPlanFilesSkipsKnownEmptyManifestsBeforeOpening(t *testing.T) {
dataPath := tableLocation + "/metadata/data-empty.avro"
deletePath := tableLocation + "/metadata/delete-empty.avro"
- dataManifest := iceberg.NewManifestFile(2, dataPath, 100,
int32(spec.ID()), snapshotID).
+ dataManifest := iceberg.NewManifestBuilder(2, dataPath, 100,
int32(spec.ID()), snapshotID).
Content(iceberg.ManifestContentData).
SequenceNum(1, 1).
AddedFiles(0).
ExistingFiles(0).
DeletedFiles(2).
Build()
- deleteManifest := iceberg.NewManifestFile(2, deletePath, 100,
int32(spec.ID()), snapshotID).
+ deleteManifest := iceberg.NewManifestBuilder(2, deletePath, 100,
int32(spec.ID()), snapshotID).
Content(iceberg.ManifestContentDeletes).
SequenceNum(1, 1).
AddedFiles(0).
@@ -1628,7 +1628,7 @@ func TestTimeTravelManifestPruningUsesSnapshotSchema(t
*testing.T) {
lower := int32Bound(10)
upper := int32Bound(20)
- manifest := iceberg.NewManifestFile(2,
"mem://default/table/metadata/manifest.avro", 100, int32(spec.ID()),
snapshotID).
+ manifest := iceberg.NewManifestBuilder(2,
"mem://default/table/metadata/manifest.avro", 100, int32(spec.ID()),
snapshotID).
Partitions([]iceberg.FieldSummary{{
ContainsNull: false,
LowerBound: &lower,
@@ -2326,7 +2326,7 @@ func TestPlanFilesUnknownTransformDoesNotPrune(t
*testing.T) {
require.NoError(t, memIO.WriteFile(manifestPath,
manifestBytes.Bytes()))
// Partition summary excludes the filter value (id == 5).
- manifest := iceberg.NewManifestFile(2, manifestPath,
int64(manifestBytes.Len()), int32(spec.ID()), snapshotID).
+ manifest := iceberg.NewManifestBuilder(2, manifestPath,
int64(manifestBytes.Len()), int32(spec.ID()), snapshotID).
Partitions([]iceberg.FieldSummary{{ContainsNull: false,
LowerBound: &lower, UpperBound: &upper}}).
SequenceNum(1, 1).
AddedFiles(1).
@@ -2494,7 +2494,7 @@ func TestPlanDataManifestTasksHandlesInaccurateCounts(t
*testing.T) {
for _, counts := range [][]int32{{5, 5, 5}, {0, 2, 1}, {-1, -1, -1}} {
scan, schema, manifests, posIndex, dvIndex, eqIndex :=
newPlanTasksBenchmarkFixture(t, 3, 3)
for i, manifest := range manifests {
- manifests[i] = iceberg.NewManifestFile(2,
manifest.FilePath(), manifest.Length(),
+ manifests[i] = iceberg.NewManifestBuilder(2,
manifest.FilePath(), manifest.Length(),
manifest.PartitionSpecID(),
manifest.SnapshotID()).
SequenceNum(manifest.SequenceNum(),
manifest.MinSequenceNum()).
AddedFiles(counts[i]).
diff --git a/table/scanner_manifest_projection_test.go
b/table/scanner_manifest_projection_test.go
index 8adcb4000..47f62d380 100644
--- a/table/scanner_manifest_projection_test.go
+++ b/table/scanner_manifest_projection_test.go
@@ -247,7 +247,7 @@ func
TestPlanDataManifestTasksWithProjectionRetainsEqualityDeletePruning(t *test
deleteManifest, err :=
deleteWriter.ToManifestFile("mem://projection-planning/deletes.avro",
int64(deleteBytes.Len()))
require.NoError(t, err)
require.NoError(t, fs.WriteFile(deleteManifest.FilePath(),
deleteBytes.Bytes()))
- deleteManifest = iceberg.NewManifestFile(2, deleteManifest.FilePath(),
int64(deleteBytes.Len()), 0, 2).
+ deleteManifest = iceberg.NewManifestBuilder(2,
deleteManifest.FilePath(), int64(deleteBytes.Len()), 0, 2).
Content(iceberg.ManifestContentDeletes).SequenceNum(2,
2).AddedFiles(2).AddedRows(2).Build()
classified, err :=
scan.collectManifestEntriesWithSchemaMinSequenceNum(t.Context(),
[]iceberg.ManifestFile{deleteManifest}, schema,
scan.partitionFiltersForSchema(schema), 0, true)
diff --git a/table/scanner_plan_tasks_bench_test.go
b/table/scanner_plan_tasks_bench_test.go
index e1a5bad4a..04e6062b1 100644
--- a/table/scanner_plan_tasks_bench_test.go
+++ b/table/scanner_plan_tasks_bench_test.go
@@ -141,7 +141,7 @@ func newPlanTasksBenchmarkFixture(
if err := fs.WriteFile(manifestPath, manifestBuf.Bytes()); err
!= nil {
b.Fatal(err)
}
- manifests[manifestIndex] = iceberg.NewManifestFile(
+ manifests[manifestIndex] = iceberg.NewManifestBuilder(
2, manifestPath, int64(manifestBuf.Len()),
int32(spec.ID()), snapshotID,
).
SequenceNum(sequenceNumber, sequenceNumber).
diff --git a/table/scanner_row_limit_bench_test.go
b/table/scanner_row_limit_bench_test.go
index 43e25df8c..59f6cf1bb 100644
--- a/table/scanner_row_limit_bench_test.go
+++ b/table/scanner_row_limit_bench_test.go
@@ -132,7 +132,7 @@ func writeRowLimitPlanningBenchmarkManifest(
require.NoError(b, err)
require.NoError(b, fs.WriteFile(manifestPath, manifestBuf.Bytes()))
- return iceberg.NewManifestFile(2, manifestPath,
int64(manifestBuf.Len()), 0, snapshotID).
+ return iceberg.NewManifestBuilder(2, manifestPath,
int64(manifestBuf.Len()), 0, snapshotID).
SequenceNum(sequenceNumber, sequenceNumber).
AddedFiles(1).
AddedRows(1).
diff --git a/table/scanner_row_limit_test.go b/table/scanner_row_limit_test.go
index eae7d80e8..fe79a3f40 100644
--- a/table/scanner_row_limit_test.go
+++ b/table/scanner_row_limit_test.go
@@ -29,7 +29,7 @@ import (
)
func rowCountManifest(path string, addedRows, existingRows int64)
iceberg.ManifestFile {
- return iceberg.NewManifestFile(3, path, 1, 0, 1).
+ return iceberg.NewManifestBuilder(3, path, 1, 0, 1).
AddedRows(addedRows).
ExistingRows(existingRows).
Build()
diff --git a/table/snapshot_manifest_cache_internal_test.go
b/table/snapshot_manifest_cache_internal_test.go
index c347d2b18..52ab91dd3 100644
--- a/table/snapshot_manifest_cache_internal_test.go
+++ b/table/snapshot_manifest_cache_internal_test.go
@@ -80,8 +80,8 @@ func TestTableScansReuseSnapshotManifestList(t *testing.T) {
}
func TestSnapshotManifestCacheSeparatesContentAndProtectsSlices(t *testing.T) {
- data := iceberg.NewManifestFile(2, "data.avro", 10, 0, 1).Build()
- deleteManifest := iceberg.NewManifestFile(2, "delete.avro", 20, 0, 1).
+ data := iceberg.NewManifestBuilder(2, "data.avro", 10, 0, 1).Build()
+ deleteManifest := iceberg.NewManifestBuilder(2, "delete.avro", 20, 0,
1).
Content(iceberg.ManifestContentDeletes).
Build()
cache := newSnapshotManifestCache()
@@ -402,7 +402,7 @@ func
TestSnapshotManifestCacheKeepsCompletedReadAfterCancellation(t *testing.T)
fs := iceio.NewMemFS()
var list bytes.Buffer
sequenceNumber := int64(1)
- manifest := iceberg.NewManifestFile(2, "data.avro", 10, 0, 1).Build()
+ manifest := iceberg.NewManifestBuilder(2, "data.avro", 10, 0, 1).Build()
require.NoError(t, iceberg.WriteManifestList(2, &list, 1, nil,
&sequenceNumber, 0, []iceberg.ManifestFile{manifest}))
const listPath = "mem://snapshot-manifest-cache/late-cancel.avro"
require.NoError(t, fs.WriteFile(listPath, list.Bytes()))
@@ -579,12 +579,12 @@ func TestSnapshotManifestCacheUsesCallerContext(t
*testing.T) {
}
func TestSnapshotManifestCacheDoesNotClassifyUnknownContentAsData(t
*testing.T) {
- unknown := iceberg.NewManifestFile(2, "unknown.avro", 1, 0, 1).
+ unknown := iceberg.NewManifestBuilder(2, "unknown.avro", 1, 0, 1).
Content(iceberg.ManifestContent(2)).
Build()
set := newSnapshotManifestSet([]iceberg.ManifestFile{
- iceberg.NewManifestFile(2, "data.avro", 1, 0, 1).Build(),
- iceberg.NewManifestFile(2, "delete.avro", 1, 0, 1).
+ iceberg.NewManifestBuilder(2, "data.avro", 1, 0, 1).Build(),
+ iceberg.NewManifestBuilder(2, "delete.avro", 1, 0, 1).
Content(iceberg.ManifestContentDeletes).
Build(),
unknown,
@@ -611,7 +611,7 @@ func TestSnapshotManifestCacheCountsDataDescriptorsOnce(t
*testing.T) {
cache := newSnapshotManifestCache()
manifests := make([]iceberg.ManifestFile,
snapshotManifestCacheManifestLimit)
for i := range manifests {
- manifests[i] = iceberg.NewManifestFile(2,
fmt.Sprintf("data-%d.avro", i), 10, 0, 1).Build()
+ manifests[i] = iceberg.NewManifestBuilder(2,
fmt.Sprintf("data-%d.avro", i), 10, 0, 1).Build()
}
set := newSnapshotManifestSet(manifests)
snapshot := Snapshot{SnapshotID: 1, ManifestList: "full.avro"}
diff --git a/table/snapshot_producers_test.go b/table/snapshot_producers_test.go
index fb6209946..8d648a86c 100644
--- a/table/snapshot_producers_test.go
+++ b/table/snapshot_producers_test.go
@@ -567,7 +567,7 @@ func TestManifestMergeManagerClosesWriterOnError(t
*testing.T) {
require.NoError(t, err, "write manifest")
require.NoError(t, mem.WriteFile(manifestPath, manifestBuf.Bytes()))
- missingManifest := iceberg.NewManifestFile(2,
"table-location/metadata/missing.avro", 1, int32(spec.ID()), sp.snapshotID).
+ missingManifest := iceberg.NewManifestBuilder(2,
"table-location/metadata/missing.avro", 1, int32(spec.ID()), sp.snapshotID).
Build()
mgr := manifestMergeManager{snap: sp}
@@ -590,7 +590,7 @@ func
TestManifestMergeManagerClosesWriterBeforeFileOnReadFailure(t *testing.T) {
[]iceberg.ManifestEntry{
iceberg.NewManifestEntry(iceberg.EntryStatusADDED,
&sp.snapshotID, nil, nil, df),
})
- missingManifest := iceberg.NewManifestFile(2,
"table-location/metadata/missing.avro", 1,
+ missingManifest := iceberg.NewManifestBuilder(2,
"table-location/metadata/missing.avro", 1,
int32(spec.ID()), sp.snapshotID).Build()
mgr := manifestMergeManager{snap: sp}
@@ -617,7 +617,7 @@ func
TestManifestMergeReturnsReadErrorBeforeCreatingWriter(t *testing.T) {
[]iceberg.ManifestEntry{
iceberg.NewManifestEntry(iceberg.EntryStatusDELETED,
&oldSnapshotID, &sequenceNumber, nil, df),
})
- missingManifest := iceberg.NewManifestFile(2,
"table-location/metadata/missing.avro", 1,
+ missingManifest := iceberg.NewManifestBuilder(2,
"table-location/metadata/missing.avro", 1,
int32(spec.ID()), sp.snapshotID).Build()
mgr := manifestMergeManager{snap: sp}
@@ -1590,7 +1590,7 @@ func
TestOverwriteParentDependentManifestsCleansCompletedRewritesOnError(t *test
}
validPath := "table-location/metadata/source-valid.avro"
validManifest := writeTestManifestWithEntries(t, mem, spec, schema,
snapshotID, validPath, entries)
- missingManifest := iceberg.NewManifestFile(2,
+ missingManifest := iceberg.NewManifestBuilder(2,
"table-location/metadata/source-missing.avro", 1,
int32(spec.ID()), snapshotID).Build()
manifests := []iceberg.ManifestFile{validManifest, missingManifest}
@@ -1857,9 +1857,9 @@ func TestFastAppendInheritsZeroCountManifests(t
*testing.T) {
seqNum1 := int64(1)
// These paths must be under the table location so the mem FS can
locate them.
- athenaManifest1 := iceberg.NewManifestFile(2,
+ athenaManifest1 := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/athena-m0.avro", 512, 0,
snap1ID).Build()
- athenaManifest2 := iceberg.NewManifestFile(2,
+ athenaManifest2 := iceberg.NewManifestBuilder(2,
"mem://default/table-location/metadata/athena-m1.avro", 256, 0,
snap1ID).Build()
// Sanity check: both manifests have zero counts, so the old filter
would drop them.
diff --git a/table/snapshots.go b/table/snapshots.go
index 38696a3ff..7e49aaad3 100644
--- a/table/snapshots.go
+++ b/table/snapshots.go
@@ -424,7 +424,7 @@ func (s Snapshot) Manifests(fio iceio.IO) (_
[]iceberg.ManifestFile, err error)
return nil, err
}
- manifests[i] = iceberg.NewManifestFile(1, path, length,
0, s.SnapshotID).
+ manifests[i] = iceberg.NewManifestBuilder(1, path,
length, 0, s.SnapshotID).
AddedFiles(-1).
ExistingFiles(-1).
DeletedFiles(-1).
diff --git a/table/updates_test.go b/table/updates_test.go
index bb4b15895..b364316e2 100644
--- a/table/updates_test.go
+++ b/table/updates_test.go
@@ -95,7 +95,7 @@ func writeManifest(t testing.TB, tio *trackingIO, snapshotID,
seqNum int64, mani
require.NoError(t, err)
require.NoError(t, tio.WriteFile(manifestPath, buf.Bytes()))
- return iceberg.NewManifestFile(2, manifestPath, int64(buf.Len()), 0,
snapshotID).
+ return iceberg.NewManifestBuilder(2, manifestPath, int64(buf.Len()), 0,
snapshotID).
SequenceNum(seqNum, seqNum).
AddedFiles(1).
AddedRows(1).