This is an automated email from the ASF dual-hosted git repository.
laskoviymishka 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 63168435f perf(table): pre-size partition data map during file
finalization (#2114)
63168435f is described below
commit 63168435f877fdf2084b550427dcd9df2a747ed4
Author: Minh Vu <[email protected]>
AuthorDate: Tue Oct 6 10:24:27 2026 +0200
perf(table): pre-size partition data map during file finalization (#2114)
* perf(table): pre-size partition data map during file finalization
* test(table): benchmark partition map growth boundaries
---
table/internal/utils.go | 2 +-
table/internal/utils_bench_test.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/table/internal/utils.go b/table/internal/utils.go
index 92e4850ce..8fb7f1e22 100644
--- a/table/internal/utils.go
+++ b/table/internal/utils.go
@@ -309,7 +309,7 @@ func (d *DataFileStatistics) ToDataFile(opts DataFileOpts)
iceberg.DataFile {
fieldIDToLogicalType := make(map[int]string)
if !opts.Spec.Equals(*iceberg.UnpartitionedSpec) {
- fieldIDToPartitionData = make(map[int]any)
+ fieldIDToPartitionData = make(map[int]any,
opts.Spec.NumFields())
for _, field := range opts.Spec.Fields() {
sourceField, sourceFieldFound :=
opts.Schema.FindFieldByIDRef(
field.SourceID(), iceberginternal.SchemaRef{})
diff --git a/table/internal/utils_bench_test.go
b/table/internal/utils_bench_test.go
index cf43478e4..a45892242 100644
--- a/table/internal/utils_bench_test.go
+++ b/table/internal/utils_bench_test.go
@@ -37,7 +37,7 @@ func (a *dataFileFinalizationBenchmarkAgg) MinAsBytes()
([]byte, error)
func (a *dataFileFinalizationBenchmarkAgg) MaxAsBytes() ([]byte, error)
{ return nil, nil }
func BenchmarkDataFileStatisticsToDataFile(b *testing.B) {
- for _, fieldCount := range []int{1, 8, 32} {
+ for _, fieldCount := range []int{0, 1, 8, 9, 32} {
schema, spec, stats :=
dataFileFinalizationBenchmarkData(fieldCount)
opts := DataFileOpts{
Schema: schema,