Skip to content

Commit b5d1cf4

Browse files
authored
chore(arrow/compute/expr): upgrade substrait-go (#234)
### Rationale for this change Dependency upgrade ### Are these changes tested? yes ### Are there any user-facing changes? yes, compute/exprs/ methods which interact with substrait will now require substrait-go/v3 objects instead.
1 parent cd0fe74 commit b5d1cf4

File tree

8 files changed

+37
-41
lines changed

8 files changed

+37
-41
lines changed

arrow/compute/exprs/builders.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import (
2727

2828
"github.com/apache/arrow-go/v18/arrow"
2929
"github.com/apache/arrow-go/v18/arrow/compute"
30-
"github.com/substrait-io/substrait-go/expr"
31-
"github.com/substrait-io/substrait-go/extensions"
32-
"github.com/substrait-io/substrait-go/types"
30+
"github.com/substrait-io/substrait-go/v3/expr"
31+
"github.com/substrait-io/substrait-go/v3/extensions"
32+
"github.com/substrait-io/substrait-go/v3/types"
3333
)
3434

3535
// NewDefaultExtensionSet constructs an empty extension set using the default
@@ -261,7 +261,8 @@ func NewFieldRef(ref compute.FieldRef, schema *arrow.Schema, ext ExtensionIDSet)
261261
return nil, err
262262
}
263263

264-
return expr.NewRootFieldRef(RefFromFieldPath(path), st.(*types.StructType))
264+
return expr.NewRootFieldRef(RefFromFieldPath(path),
265+
types.NewRecordTypeFromStruct(*st.(*types.StructType)))
265266
}
266267

267268
// Builder wraps the substrait-go expression Builder and FuncArgBuilder
@@ -311,7 +312,7 @@ func (e *ExprBuilder) SetInputSchema(s *arrow.Schema) error {
311312
}
312313

313314
e.inputSchema = s
314-
e.b.BaseSchema = st.(*types.StructType)
315+
e.b.BaseSchema = types.NewRecordTypeFromStruct(*st.(*types.StructType))
315316
return nil
316317
}
317318

arrow/compute/exprs/builders_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/apache/arrow-go/v18/arrow/compute/exprs"
2626
"github.com/stretchr/testify/assert"
2727
"github.com/stretchr/testify/require"
28-
"github.com/substrait-io/substrait-go/expr"
28+
"github.com/substrait-io/substrait-go/v3/expr"
2929
)
3030

3131
func TestNewScalarFunc(t *testing.T) {

arrow/compute/exprs/exec.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ import (
3232
"github.com/apache/arrow-go/v18/arrow/internal/debug"
3333
"github.com/apache/arrow-go/v18/arrow/memory"
3434
"github.com/apache/arrow-go/v18/arrow/scalar"
35-
"github.com/substrait-io/substrait-go/expr"
36-
"github.com/substrait-io/substrait-go/extensions"
37-
"github.com/substrait-io/substrait-go/types"
35+
"github.com/substrait-io/substrait-go/v3/expr"
36+
"github.com/substrait-io/substrait-go/v3/extensions"
37+
"github.com/substrait-io/substrait-go/v3/types"
3838
)
3939

4040
func makeExecBatch(ctx context.Context, schema *arrow.Schema, partial compute.Datum) (out compute.ExecBatch, err error) {

arrow/compute/exprs/exec_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ import (
3333
"github.com/google/uuid"
3434
"github.com/stretchr/testify/assert"
3535
"github.com/stretchr/testify/require"
36-
"github.com/substrait-io/substrait-go/expr"
37-
"github.com/substrait-io/substrait-go/types"
36+
"github.com/substrait-io/substrait-go/v3/expr"
37+
"github.com/substrait-io/substrait-go/v3/types"
3838
)
3939

4040
var (
@@ -172,8 +172,8 @@ func TestComparisons(t *testing.T) {
172172
}
173173

174174
ex, err := exprs.NewScalarCall(extSet, fn, nil,
175-
expr.MustExpr(expr.NewRootFieldRef(expr.NewStructFieldRef(0), &baseStruct.Struct)),
176-
expr.MustExpr(expr.NewRootFieldRef(expr.NewStructFieldRef(1), &baseStruct.Struct)))
175+
expr.MustExpr(expr.NewRootFieldRef(expr.NewStructFieldRef(0), types.NewRecordTypeFromStruct(baseStruct.Struct))),
176+
expr.MustExpr(expr.NewRootFieldRef(expr.NewStructFieldRef(1), types.NewRecordTypeFromStruct(baseStruct.Struct))))
177177
require.NoError(t, err)
178178

179179
expression := &expr.Extended{

arrow/compute/exprs/field_refs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/apache/arrow-go/v18/arrow/compute"
2727
"github.com/apache/arrow-go/v18/arrow/memory"
2828
"github.com/apache/arrow-go/v18/arrow/scalar"
29-
"github.com/substrait-io/substrait-go/expr"
29+
"github.com/substrait-io/substrait-go/v3/expr"
3030
)
3131

3232
func getFields(typ arrow.DataType) []arrow.Field {

arrow/compute/exprs/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import (
2626

2727
"github.com/apache/arrow-go/v18/arrow"
2828
"github.com/apache/arrow-go/v18/arrow/compute"
29-
"github.com/substrait-io/substrait-go/expr"
30-
"github.com/substrait-io/substrait-go/extensions"
31-
"github.com/substrait-io/substrait-go/types"
29+
"github.com/substrait-io/substrait-go/v3/expr"
30+
"github.com/substrait-io/substrait-go/v3/extensions"
31+
"github.com/substrait-io/substrait-go/v3/types"
3232
)
3333

3434
const (

go.mod

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ require (
3838
github.com/pierrec/lz4/v4 v4.1.22
3939
github.com/stoewer/go-strcase v1.3.0
4040
github.com/stretchr/testify v1.10.0
41-
github.com/substrait-io/substrait-go v1.2.0
41+
github.com/substrait-io/substrait-go/v3 v3.2.0
4242
github.com/tidwall/sjson v1.2.5
4343
github.com/zeebo/xxh3 v1.0.2
4444
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
4545
golang.org/x/sync v0.10.0
4646
golang.org/x/sys v0.28.0
4747
golang.org/x/tools v0.28.0
48-
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028
48+
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da
4949
gonum.org/v1/gonum v0.15.1
5050
google.golang.org/grpc v1.69.2
5151
google.golang.org/protobuf v1.36.1
5252
modernc.org/sqlite v1.29.6
5353
)
5454

5555
require (
56-
github.com/alecthomas/participle/v2 v2.1.0 // indirect
56+
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
5757
github.com/creasty/defaults v1.8.0 // indirect
5858
github.com/davecgh/go-spew v1.1.1 // indirect
5959
github.com/dustin/go-humanize v1.0.1 // indirect
@@ -63,16 +63,15 @@ require (
6363
github.com/json-iterator/go v1.1.12 // indirect
6464
github.com/kr/text v0.2.0 // indirect
6565
github.com/mattn/go-colorable v0.1.13 // indirect
66-
github.com/mattn/go-isatty v0.0.19 // indirect
66+
github.com/mattn/go-isatty v0.0.20 // indirect
6767
github.com/mitchellh/mapstructure v1.5.0 // indirect
6868
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6969
github.com/modern-go/reflect2 v1.0.2 // indirect
7070
github.com/ncruces/go-strftime v0.1.9 // indirect
7171
github.com/pmezard/go-difflib v1.0.0 // indirect
7272
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
73-
github.com/rogpeppe/go-internal v1.9.0 // indirect
7473
github.com/stretchr/objx v0.5.2 // indirect
75-
github.com/substrait-io/substrait v0.57.1 // indirect
74+
github.com/substrait-io/substrait v0.62.0 // indirect
7675
github.com/tidwall/gjson v1.14.2 // indirect
7776
github.com/tidwall/match v1.1.1 // indirect
7877
github.com/tidwall/pretty v1.2.0 // indirect

go.sum

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU=
22
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
3-
github.com/alecthomas/assert/v2 v2.3.0 h1:mAsH2wmvjsuvyBvAmCtm7zFsBlb8mIHx5ySLVdDZXL0=
4-
github.com/alecthomas/assert/v2 v2.3.0/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
5-
github.com/alecthomas/participle/v2 v2.1.0 h1:z7dElHRrOEEq45F2TG5cbQihMtNTv8vwldytDj7Wrz4=
6-
github.com/alecthomas/participle/v2 v2.1.0/go.mod h1:Y1+hAs8DHPmc3YUFzqllV+eSQ9ljPTk0ZkPMtEdAx2c=
7-
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
8-
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
93
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
104
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
5+
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
6+
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
117
github.com/apache/thrift v0.21.0 h1:tdPmh/ptjE1IJnhbhrcl2++TauVjy242rkV/UzJChnE=
128
github.com/apache/thrift v0.21.0/go.mod h1:W1H8aR/QRtYNvrPeFXBtobyRkd0/YVhTc6i07XIAgDw=
9+
github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg=
10+
github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc=
1311
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
1412
github.com/creasty/defaults v1.8.0 h1:z27FJxCAa0JKt3utc0sCImAEb+spPucmKoOdLHvHYKk=
1513
github.com/creasty/defaults v1.8.0/go.mod h1:iGzKe6pbEHnpMPtfDXZEr0NVxWnPTjb1bbDy08fPzYM=
@@ -53,8 +51,6 @@ github.com/hamba/avro/v2 v2.27.0 h1:IAM4lQ0VzUIKBuo4qlAiLKfqALSrFC+zi1iseTtbBKU=
5351
github.com/hamba/avro/v2 v2.27.0/go.mod h1:jN209lopfllfrz7IGoZErlDz+AyUJ3vrBePQFZwYf5I=
5452
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
5553
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
56-
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
57-
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
5854
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
5955
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
6056
github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4=
@@ -72,8 +68,8 @@ github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgx
7268
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
7369
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
7470
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
75-
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
76-
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
71+
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
72+
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
7773
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
7874
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
7975
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs=
@@ -95,8 +91,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
9591
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
9692
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
9793
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
98-
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
99-
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
94+
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
95+
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
10096
github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
10197
github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
10298
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -110,10 +106,10 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
110106
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
111107
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
112108
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
113-
github.com/substrait-io/substrait v0.57.1 h1:GW8nnYfSowMseHR8Os82/X6lNtQGIK7p4p+lr6r+auw=
114-
github.com/substrait-io/substrait v0.57.1/go.mod h1:q9s+tjo+gK0lsA+SqYB0lhojNuxvdPdfYlGUP0hjbrA=
115-
github.com/substrait-io/substrait-go v1.2.0 h1:3ZNRkc8FYD7ifCagKEOZQtUcgMceMQfwo2N1NGaK4Q4=
116-
github.com/substrait-io/substrait-go v1.2.0/go.mod h1:IPsy24rdjp/buXR+T8ENl6QCnSCS6h+uM8P+GaZez7c=
109+
github.com/substrait-io/substrait v0.62.0 h1:olgrvRKwzKBQJymbbXKopgAE0wZER9U/uVZviL33A0s=
110+
github.com/substrait-io/substrait v0.62.0/go.mod h1:MPFNw6sToJgpD5Z2rj0rQrdP/Oq8HG7Z2t3CAEHtkHw=
111+
github.com/substrait-io/substrait-go/v3 v3.2.0 h1:TPSzqSNdhpgYI9aZpHtfAoNMJuqUslBqzfthai0Ymqs=
112+
github.com/substrait-io/substrait-go/v3 v3.2.0/go.mod h1:F/BIXKJXddJSzUwbHnRVcz973mCVsTfBpTUvUNX7ptM=
117113
github.com/tidwall/gjson v1.14.2 h1:6BBkirS0rAHjumnjHF6qgy5d2YAJ1TLIaFE2lzfOLqo=
118114
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
119115
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
@@ -156,8 +152,8 @@ golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
156152
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
157153
golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
158154
golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
159-
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
160-
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
155+
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY=
156+
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
161157
gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0=
162158
gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o=
163159
google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE=

0 commit comments

Comments
 (0)