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 51aed6d58 refactor(table)!: remove WitMaxConcurrency and 
RewriteFiles.Apply (#2177)
51aed6d58 is described below

commit 51aed6d58730878a560a611f97f23ef2c1e7b3a7
Author: Andrei Tserakhau <[email protected]>
AuthorDate: Tue Oct 13 14:26:35 2026 +0200

    refactor(table)!: remove WitMaxConcurrency and RewriteFiles.Apply (#2177)
    
    refactor(table)!: remove deprecated WitMaxConcurrency and RewriteFiles.Apply
    
    WitMaxConcurrency was a misspelled alias of WithMaxConcurrency. Use
    WithMaxConcurrency.
    
    RewriteFiles.Apply took three slices and had no slot for deletion vectors,
    so wiring worker output through it left the DVs of rewritten files orphaned.
    Use RewriteFiles.ApplyResult with a CompactionGroupResult instead, for
    example ApplyResult(CompactionGroupResult{OldDataFiles: deletes,
    NewDataFiles: adds, SafePosDeletes: safeDeletes}), or call DeleteFile and
    AddFile directly.
    
    This is a breaking change for callers of the removed symbols.
    
    Part of the v1.0 API cleanup in #2062.
    
    Signed-off-by: laskoviymishka <[email protected]>
---
 table/rewrite_files.go       | 31 +------------------------------
 table/rewrite_files_test.go  |  2 +-
 table/scan_options_test.go   | 11 -----------
 table/table.go               |  8 --------
 website/src/configuration.md |  2 +-
 5 files changed, 3 insertions(+), 51 deletions(-)

diff --git a/table/rewrite_files.go b/table/rewrite_files.go
index 0c6835f72..37c14306f 100644
--- a/table/rewrite_files.go
+++ b/table/rewrite_files.go
@@ -271,38 +271,9 @@ func (r *RewriteFiles) AddFile(df iceberg.DataFile) 
*RewriteFiles {
        }
 }
 
-// Apply is a bulk shortcut that routes three slices onto this builder:
-// every entry in deletes is queued via
-// [RewriteFiles.DeleteFile] (which routes data vs. delete files by
-// content type), every entry in adds via [RewriteFiles.AddFile], and every
-// entry in safeDeletes as an automatic delete-file removal.
-//
-// Deprecated: use [RewriteFiles.ApplyResult], which also carries
-// SafeDeletionVectors. Apply has no slot for them, so a coordinator wiring
-// worker output through Apply leaves deletion vectors for the rewritten files
-// orphaned.
-func (r *RewriteFiles) Apply(deletes, adds, safeDeletes []iceberg.DataFile) 
*RewriteFiles {
-       if r.err != nil {
-               return r
-       }
-
-       for _, df := range deletes {
-               r.DeleteFile(df)
-       }
-       for _, df := range adds {
-               r.AddFile(df)
-       }
-       for _, df := range safeDeletes {
-               r.removeAutomaticDeleteFile(df)
-       }
-
-       return r
-}
-
 // ApplyResult queues a worker's [CompactionGroupResult] onto this builder,
 // routing OldDataFiles (DeleteFile), NewDataFiles (AddFile), SafePosDeletes
-// and SafeDeletionVectors as automatic delete-file removals. Prefer it over
-// [RewriteFiles.Apply], which cannot carry SafeDeletionVectors.
+// and SafeDeletionVectors as automatic delete-file removals.
 //
 // Typical distributed-coordinator pattern:
 //
diff --git a/table/rewrite_files_test.go b/table/rewrite_files_test.go
index 63ed00b25..6c4e3e5f2 100644
--- a/table/rewrite_files_test.go
+++ b/table/rewrite_files_test.go
@@ -544,7 +544,7 @@ func TestRewriteFiles_RejectsNilDataFile(t *testing.T) {
 // [Transaction.RewriteDataFiles]: workers run [table.ExecuteCompactionGroup]
 // per group (here inline; in distributed compaction this happens on
 // remote peers and the results travel over the wire), then a single
-// leader transaction stages [table.RewriteFiles.Apply] +
+// leader transaction stages [table.RewriteFiles.ApplyResult] +
 // [table.RewriteFiles.Commit] for one atomic snapshot.
 func TestRewriteFiles_DistributedEquivalence(t *testing.T) {
        tbl := newRewriteTestTable(t)
diff --git a/table/scan_options_test.go b/table/scan_options_test.go
index d8ed5a158..99b517ac1 100644
--- a/table/scan_options_test.go
+++ b/table/scan_options_test.go
@@ -55,14 +55,3 @@ func TestWithMaxConcurrency(t *testing.T) {
                })
        }
 }
-
-// The deprecated WitMaxConcurrency alias must stay in lock-step with the
-// canonical WithMaxConcurrency so callers on the old name don't drift.
-func TestWitMaxConcurrencyAliasParity(t *testing.T) {
-       for _, n := range []int{-1, 0, 1, 8} {
-               canonical, alias := &Scan{}, &Scan{}
-               WithMaxConcurrency(n)(canonical)
-               WitMaxConcurrency(n)(alias)
-               assert.Equal(t, canonical.concurrency, alias.concurrency, 
"n=%d", n)
-       }
-}
diff --git a/table/table.go b/table/table.go
index f21e8cba0..48d2ea51a 100644
--- a/table/table.go
+++ b/table/table.go
@@ -1295,14 +1295,6 @@ func WithMaxConcurrency(n int) ScanOption {
        }
 }
 
-// WitMaxConcurrency is a deprecated alias for [WithMaxConcurrency], kept for
-// backward compatibility with the pre-existing typo'd name.
-//
-// Deprecated: use [WithMaxConcurrency].
-func WitMaxConcurrency(n int) ScanOption {
-       return WithMaxConcurrency(n)
-}
-
 func WithOptions(opts iceberg.Properties) ScanOption {
        if opts == nil {
                return noopOption
diff --git a/website/src/configuration.md b/website/src/configuration.md
index a249117ca..4db0d1d7b 100644
--- a/website/src/configuration.md
+++ b/website/src/configuration.md
@@ -285,7 +285,7 @@ There is no `PYICEBERG_*`-style env var convention. Use the 
YAML config file or
 | Setting | Source | Effect |
 |---|---|---|
 | `max-workers` in `~/.iceberg-go.yaml` (`config.EnvConfig.MaxWorkers`) | YAML 
config | Worker pool size used by parallel column writes, snapshot producers, 
scan plan, equality-delete writers. Default `5`. |
-| `WithMaxConcurrency(n int) ScanOption` | Code (`table.WithMaxConcurrency`) | 
Per-scan override. `WitMaxConcurrency` (missing `h`) remains as a deprecated 
alias. |
+| `WithMaxConcurrency(n int) ScanOption` | Code (`table.WithMaxConcurrency`) | 
Per-scan override. |
 | `WithMaxWriteWorkers(n int)` | Code (per-write API on `WriteRecords`) | 
Per-write override of the worker count. |
 | `WithClusteredWrite()` | Code (per-write API on `WriteRecords`) | Forces 
single-threaded writes. Mutually exclusive with `WithMaxWriteWorkers`. |
 

Reply via email to