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 9b5a2724a refactor(substrait)!: drop unused case-sensitivity parameter 
before v1 (#2280)
9b5a2724a is described below

commit 9b5a2724aafcf40ca02b54698f2dc7ac6a166233
Author: Minh Vu <[email protected]>
AuthorDate: Fri Oct 23 23:10:08 2026 +0200

    refactor(substrait)!: drop unused case-sensitivity parameter before v1 
(#2280)
    
    * refactor(substrait)!: drop unused case-sensitivity parameter
    
    Case sensitivity is already applied while binding the expression.
    ConvertExpr only consumes bound expressions and ignores its third argument.
    Remove the redundant argument before v1 and update its callers.
    
    Signed-off-by: Minh Vu <[email protected]>
    
    * fix(table): update remaining substrait call
    
    Signed-off-by: Minh Vu <[email protected]>
    
    * docs(releases): note pre-v1 breaking API migration
    
    ---------
    
    Signed-off-by: Minh Vu <[email protected]>
    Co-authored-by: Matt Topol <[email protected]>
---
 table/arrow_filter_plan.go        |  2 +-
 table/substrait/substrait.go      |  6 +++---
 table/substrait/substrait_test.go | 16 ++++++++--------
 table/transaction.go              |  2 +-
 website/src/releases.md           |  2 ++
 5 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/table/arrow_filter_plan.go b/table/arrow_filter_plan.go
index 7d693663b..168353651 100644
--- a/table/arrow_filter_plan.go
+++ b/table/arrow_filter_plan.go
@@ -393,7 +393,7 @@ func compileFileFilterPlan(
                return plan, nil
        }
 
-       extSet, recordFilter, err := substrait.ConvertExpr(recordSchema, 
boundFilter, caseSensitive)
+       extSet, recordFilter, err := substrait.ConvertExpr(recordSchema, 
boundFilter)
        if err != nil {
                return nil, err
        }
diff --git a/table/substrait/substrait.go b/table/substrait/substrait.go
index bcb670bb9..c8a871e6c 100644
--- a/table/substrait/substrait.go
+++ b/table/substrait/substrait.go
@@ -53,9 +53,9 @@ func NewExtensionSet() exprs.ExtensionIDSet {
 }
 
 // ConvertExpr converts a bound expression to a Substrait expression so that 
it can
-// be utilized for computation. Case sensitivity is applied when binding; the 
third
-// argument is retained for API compatibility.
-func ConvertExpr(schema *iceberg.Schema, e iceberg.BooleanExpression, _ bool) 
(*expr.ExtensionRegistry, expr.Expression, error) {
+// be utilized for computation. Case sensitivity is applied when binding
+// the expression, before it is passed to ConvertExpr.
+func ConvertExpr(schema *iceberg.Schema, e iceberg.BooleanExpression) 
(*expr.ExtensionRegistry, expr.Expression, error) {
        base, err := ConvertSchema(schema)
        if err != nil {
                return nil, nil, err
diff --git a/table/substrait/substrait_test.go 
b/table/substrait/substrait_test.go
index d27e4aabd..fffc39470 100644
--- a/table/substrait/substrait_test.go
+++ b/table/substrait/substrait_test.go
@@ -70,7 +70,7 @@ func TestRefTypes(t *testing.T) {
 
                        idx := ref.(iceberg.BoundPredicate).Term().Ref().Pos()
 
-                       _, converted, err := substrait.ConvertExpr(sc, ref, 
true)
+                       _, converted, err := substrait.ConvertExpr(sc, ref)
                        require.NoError(t, err)
 
                        assert.Equal(t, fmt.Sprintf("is_null(.field(%d) => %s) 
=> boolean", idx,
@@ -112,7 +112,7 @@ func TestNestedReferencesPreserveBoundPath(t *testing.T) {
                        bound, err := tt.predicate.Bind(sc, true)
                        require.NoError(t, err)
 
-                       _, converted, err := substrait.ConvertExpr(sc, bound, 
true)
+                       _, converted, err := substrait.ConvertExpr(sc, bound)
                        require.NoError(t, err)
                        assert.Contains(t, converted.String(), tt.expected)
                })
@@ -128,7 +128,7 @@ func TestNestedReferenceWithoutTopLevelLeafName(t 
*testing.T) {
        bound, err := iceberg.EqualTo(iceberg.Reference("customer.id"), 
int64(123)).Bind(sc, true)
        require.NoError(t, err)
 
-       _, converted, err := substrait.ConvertExpr(sc, bound, true)
+       _, converted, err := substrait.ConvertExpr(sc, bound)
        require.NoError(t, err)
        assert.Contains(t, converted.String(), ".field(0).field(0)")
 }
@@ -184,7 +184,7 @@ func TestExprs(t *testing.T) {
                        bound, err := iceberg.BindExpr(tt.schema, tt.e, false)
                        require.NoError(t, err)
 
-                       _, result, err := substrait.ConvertExpr(tt.schema, 
bound, true)
+                       _, result, err := substrait.ConvertExpr(tt.schema, 
bound)
                        require.NoError(t, err)
                        assert.Equal(t, tt.expected, result.String())
                })
@@ -206,7 +206,7 @@ func TestTransformPredicatesAreRejected(t *testing.T) {
                bound, err := predicate.Bind(sc, true)
                require.NoError(t, err)
 
-               _, _, err = substrait.ConvertExpr(sc, bound, true)
+               _, _, err = substrait.ConvertExpr(sc, bound)
                require.ErrorIs(t, err, iceberg.ErrNotImplemented)
                assert.ErrorContains(t, err, "transformed terms")
        }
@@ -263,7 +263,7 @@ func TestNanosecondTimestampLiterals(t *testing.T) {
                        bound, err := iceberg.BindExpr(sc, tt.predicate, true)
                        require.NoError(t, err)
 
-                       _, converted, err := substrait.ConvertExpr(sc, bound, 
true)
+                       _, converted, err := substrait.ConvertExpr(sc, bound)
                        require.NoError(t, err)
                        assert.Equal(t, tt.wantExpr, converted.String())
                })
@@ -284,7 +284,7 @@ func TestVariantSchemaConversionDoesNotPanic(t *testing.T) {
        pred, err := iceberg.EqualTo(iceberg.Reference("id"), 
int64(1)).Bind(sc, true)
        require.NoError(t, err)
 
-       _, expr, err := substrait.ConvertExpr(sc, pred, true)
+       _, expr, err := substrait.ConvertExpr(sc, pred)
        require.NoError(t, err)
        assert.NotNil(t, expr)
 }
@@ -303,7 +303,7 @@ func TestBBoxPredicateConvertsToTypedError(t *testing.T) {
                iceberg.BoundingBox{MinX: 0, MinY: 0, MaxX: 10, MaxY: 
10}).Bind(sc, true)
        require.NoError(t, err)
 
-       _, _, err = substrait.ConvertExpr(sc, bound, true)
+       _, _, err = substrait.ConvertExpr(sc, bound)
        require.Error(t, err)
        assert.ErrorIs(t, err, iceberg.ErrNotImplemented)
 }
diff --git a/table/transaction.go b/table/transaction.go
index 9fbdf8462..2faa2ec01 100644
--- a/table/transaction.go
+++ b/table/transaction.go
@@ -2686,7 +2686,7 @@ func prepareBatchFilter(filter iceberg.BooleanExpression, 
schema *iceberg.Schema
                }, nil
        }
 
-       extSet, substraitFilter, err := substrait.ConvertExpr(schema, bound, 
caseSensitive)
+       extSet, substraitFilter, err := substrait.ConvertExpr(schema, bound)
        if err != nil {
                return nil, fmt.Errorf("prepareBatchFilter: convert expression: 
%w", err)
        }
diff --git a/website/src/releases.md b/website/src/releases.md
index 0874a7ad2..3bda31a15 100644
--- a/website/src/releases.md
+++ b/website/src/releases.md
@@ -42,6 +42,8 @@ Per-release notes (highlights, breaking changes, 
contributors) are published on
 
 ### Unreleased compatibility notes
 
+- **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.
+
 - **Transform formatting requires the result type.** 
`Transform.ToHumanStr(value)` is removed. Use 
`Transform.ToHumanStrType(resultType, value)` to format partition values, 
including timestamps with time zones.
 
 - **Puffin writer property setter renamed.** `puffin.Writer.AddProperties` is 
now `puffin.Writer.SetProperties`. Repeated calls still merge keys; use 
`ClearProperties` to clear custom properties before finishing.

Reply via email to