From 18277e5a31110180256fe60f10ee800017ed2606 Mon Sep 17 00:00:00 2001 From: laskoviymishka Date: Thu, 19 Nov 2026 13:38:40 +0000 Subject: [PATCH] refactor(table)!: move table/substrait to table/internal/substrait ConvertExpr, ConvertSchema and NewExtensionSet return substrait-go v8 and arrow compute/exprs types, which pins those third-party types into the exported API. The package is only used inside table, so move it under table/internal with its tests, benchmark and the embedded functions_set.yaml, and update the four importing files in table. This is a pure move: package name, code and behavior are unchanged. Code importing table/substrait no longer compiles and there is no replacement. substrait-go stays a module dependency because table still uses it internally. Signed-off-by: laskoviymishka --- table/arrow_filter_plan.go | 2 +- table/arrow_scanner.go | 2 +- table/{ => internal}/substrait/endian_be.go | 0 table/{ => internal}/substrait/endian_fallback.go | 0 table/{ => internal}/substrait/endian_le.go | 0 table/{ => internal}/substrait/functions_set.yaml | 0 table/{ => internal}/substrait/substrait.go | 0 table/{ => internal}/substrait/substrait_bench_test.go | 0 .../{ => internal}/substrait/substrait_decimal_internal_test.go | 0 table/{ => internal}/substrait/substrait_test.go | 2 +- table/transaction.go | 2 +- table/transaction_delete.go | 2 +- website/src/releases.md | 1 + 13 files changed, 6 insertions(+), 5 deletions(-) rename table/{ => internal}/substrait/endian_be.go (100%) rename table/{ => internal}/substrait/endian_fallback.go (100%) rename table/{ => internal}/substrait/endian_le.go (100%) rename table/{ => internal}/substrait/functions_set.yaml (100%) rename table/{ => internal}/substrait/substrait.go (100%) rename table/{ => internal}/substrait/substrait_bench_test.go (100%) rename table/{ => internal}/substrait/substrait_decimal_internal_test.go (100%) rename table/{ => internal}/substrait/substrait_test.go (99%) diff --git a/table/arrow_filter_plan.go b/table/arrow_filter_plan.go index 9851a0a947..a7b7c88657 100644 --- a/table/arrow_filter_plan.go +++ b/table/arrow_filter_plan.go @@ -30,7 +30,7 @@ import ( "github.com/apache/iceberg-go" iceinternal "github.com/apache/iceberg-go/internal" tblutils "github.com/apache/iceberg-go/table/internal" - "github.com/apache/iceberg-go/table/substrait" + "github.com/apache/iceberg-go/table/internal/substrait" "github.com/substrait-io/substrait-go/v8/expr" ) diff --git a/table/arrow_scanner.go b/table/arrow_scanner.go index 48a37680bf..1f242665cb 100644 --- a/table/arrow_scanner.go +++ b/table/arrow_scanner.go @@ -43,7 +43,7 @@ import ( iceio "github.com/apache/iceberg-go/io" "github.com/apache/iceberg-go/table/dv" tblutils "github.com/apache/iceberg-go/table/internal" - "github.com/apache/iceberg-go/table/substrait" + "github.com/apache/iceberg-go/table/internal/substrait" "github.com/substrait-io/substrait-go/v8/expr" "golang.org/x/sync/errgroup" ) diff --git a/table/substrait/endian_be.go b/table/internal/substrait/endian_be.go similarity index 100% rename from table/substrait/endian_be.go rename to table/internal/substrait/endian_be.go diff --git a/table/substrait/endian_fallback.go b/table/internal/substrait/endian_fallback.go similarity index 100% rename from table/substrait/endian_fallback.go rename to table/internal/substrait/endian_fallback.go diff --git a/table/substrait/endian_le.go b/table/internal/substrait/endian_le.go similarity index 100% rename from table/substrait/endian_le.go rename to table/internal/substrait/endian_le.go diff --git a/table/substrait/functions_set.yaml b/table/internal/substrait/functions_set.yaml similarity index 100% rename from table/substrait/functions_set.yaml rename to table/internal/substrait/functions_set.yaml diff --git a/table/substrait/substrait.go b/table/internal/substrait/substrait.go similarity index 100% rename from table/substrait/substrait.go rename to table/internal/substrait/substrait.go diff --git a/table/substrait/substrait_bench_test.go b/table/internal/substrait/substrait_bench_test.go similarity index 100% rename from table/substrait/substrait_bench_test.go rename to table/internal/substrait/substrait_bench_test.go diff --git a/table/substrait/substrait_decimal_internal_test.go b/table/internal/substrait/substrait_decimal_internal_test.go similarity index 100% rename from table/substrait/substrait_decimal_internal_test.go rename to table/internal/substrait/substrait_decimal_internal_test.go diff --git a/table/substrait/substrait_test.go b/table/internal/substrait/substrait_test.go similarity index 99% rename from table/substrait/substrait_test.go rename to table/internal/substrait/substrait_test.go index 1df96e7908..61a59e53c6 100644 --- a/table/substrait/substrait_test.go +++ b/table/internal/substrait/substrait_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/apache/iceberg-go" - "github.com/apache/iceberg-go/table/substrait" + "github.com/apache/iceberg-go/table/internal/substrait" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/substrait-io/substrait-go/v8/types" diff --git a/table/transaction.go b/table/transaction.go index c8a6a037d8..6d686e8e8a 100644 --- a/table/transaction.go +++ b/table/transaction.go @@ -36,7 +36,7 @@ import ( "github.com/apache/iceberg-go" iceberginternal "github.com/apache/iceberg-go/internal" "github.com/apache/iceberg-go/io" - "github.com/apache/iceberg-go/table/substrait" + "github.com/apache/iceberg-go/table/internal/substrait" "github.com/google/uuid" ) diff --git a/table/transaction_delete.go b/table/transaction_delete.go index a966bf16ce..bab0e1a4d4 100644 --- a/table/transaction_delete.go +++ b/table/transaction_delete.go @@ -35,7 +35,7 @@ import ( "github.com/apache/iceberg-go/io" "github.com/apache/iceberg-go/table/dv" tblutils "github.com/apache/iceberg-go/table/internal" - "github.com/apache/iceberg-go/table/substrait" + "github.com/apache/iceberg-go/table/internal/substrait" "github.com/google/uuid" "golang.org/x/sync/errgroup" ) diff --git a/website/src/releases.md b/website/src/releases.md index 26c1f867e8..1f088bdbc5 100644 --- a/website/src/releases.md +++ b/website/src/releases.md @@ -120,6 +120,7 @@ Per-release notes (highlights, breaking changes, contributors) are published on - **Orphan cleanup results now expose only `OrphanFiles`.** Replace `result.OrphanFileLocations` with `result.OrphanFiles` (each entry has `Path` and `SizeBytes`). `OrphanCleanupPlan.Files()` still provides path-only lists during planning. - **Catalog identifier helper renamed.** `catalog.TableNameFromIdent` is removed. Use `catalog.ObjectNameFromIdent` for tables, views, and functions. - **Substrait expression conversion no longer takes case sensitivity.** `substrait.ConvertExpr(schema, expression, caseSensitive)` becomes `substrait.ConvertExpr(schema, expression)`. Case sensitivity remains part of expression binding. +- **`table/substrait` is now internal.** The package moved to `table/internal/substrait`, so `substrait.ConvertExpr`, `substrait.ConvertSchema` and `substrait.NewExtensionSet` are no longer exported. There is no replacement; scans and deletes still convert filters internally. - **Transform formatting requires the result type and uses the Java-aligned method name.** `Transform.ToHumanStr(value)` and `Transform.ToHumanStrType(resultType, value)` are removed. Use `Transform.ToHumanString(resultType, value)` to format partition values, including timestamps with time zones. - **Catalogs now require cleanup.** The `catalog.Catalog` interface includes `Close() error`. Custom catalog implementations must provide `Close`, and callers should close catalog instances after use. `catalog.Closer` is removed. Replace `cat.(catalog.Closer)` checks with `defer cat.Close()`; `catalog.Catalog` already implements `io.Closer`, so no type assertion is needed.