Skip to content

chore: Bump github.com/substrait-io/substrait-go from v8.1.1 to v9.0.0 - #1399

Open
kadinrabo wants to merge 5 commits into
apache:mainfrom
kadinrabo:kr/substrait-go-v9-alpha2
Open

kadinrabo wants to merge 5 commits into
apache:mainfrom
kadinrabo:kr/substrait-go-v9-alpha2

Conversation

@kadinrabo

@kadinrabo kadinrabo commented Oct 21, 2026 •

Copy link
Copy Markdown

Rationale for this change

Upgrade substrait-go to the latest major version (v9). I'm visiting from @substrait-io and want to bump this so I can update the dependency in iceberg-go.

v9 finishes moving protobuf out of substrait-go core, so substrait-protobuf/go drops out of arrow-go entirely.

What changes are included in this PR?

  • Updated github.com/substrait-io/substrait-go from v8.1.1 to v9.0.0, and import paths from v8 to v9 across arrow/compute/exprs
  • Dropped github.com/substrait-io/substrait-protobuf/go v0.85.0, no longer reachable
  • extensions.ID is now extensions.ExtensionID, with conversions where v9 asks for TypeID, FunctionID or TypeVariationID
  • types.Behavior* became the types.CastFailBehavior* enum, and types.PrecisionTimestamp is a plain struct

Are these changes tested?

Existing tests pass (go test ./arrow/compute/...). Also verified iceberg-go builds and tests green against this branch.

Are there any user-facing changes?

Users importing arrow/compute/exprs will transitively depend on substrait-go v9 instead of v8, and no longer get substrait-protobuf. Exported signatures taking extensions.ID now take extensions.ExtensionID.

@zeroshade

Copy link
Copy Markdown
Member

happy to move forward with this once we have a stable tag instead of the alpha one.

@kadinrabo kadinrabo changed the title chore: Bump github.com/substrait-io/substrait-go from v8.1.1 to v9.0.0-alpha.2 chore: Bump github.com/substrait-io/substrait-go from v8.1.1 to v9.0.0 Nov 3, 2026
@kadinrabo
kadinrabo marked this pull request as ready for review November 3, 2026 20:33
@kadinrabo
kadinrabo requested a review from zeroshade as a code owner November 3, 2026 20:33
@zeroshade

Copy link
Copy Markdown
Member

Why does substrait-go do so many breaking changes and major version updates? 😦

I'm unsure on this because of the breaking changes to public APIs that this is doing (the change from extensions.ID to extensions.ExtensionID. We should probably use aliases or other changes in here to hide the public substrait types from the arrow-go public API to avoid these in the future.

@vbarua

vbarua commented Nov 4, 2026

Copy link
Copy Markdown

happy to move forward with this once we have a stable tag instead of the alpha one.

For this PR, we just published the first official v9 release: https://pkg.go.dev/github.com/substrait-io/substrait-go/v9

@kadinrabo was checking that the alpha build compiled correctly for arrow-go before we published it. He's updated this to use the official release.

Why does substrait-go do so many breaking changes and major version updates? 😦

Honestly, because we accidentally published the first v1 release before the library should have been considered stable, and we never put the cat back in the bag. If the constant major updates are becoming a problem, we can consider starting fresh with a new name to limit these issues in the future.

We should probably use aliases or other changes in here to hide the public substrait types from the arrow-go public API to avoid these in the future.

Would it make sense to add the aliases in this PR if this is going to be breaking already? It would probably be good the decouple the arrow-go API from the substrait-go one.

Comment thread arrow/compute/exprs/types.go Outdated

type substraitToArrow = func(*expr.ScalarFunction, []compute.Datum) (fname string, args []compute.Datum, opts compute.FunctionOptions, err error)
type arrowToSubstrait = func(fname string) (extensions.ID, []*types.FunctionOption, error)
type arrowToSubstrait = func(fname string) (extensions.ExtensionID, []*types.FunctionOption, error)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be extension.FunctionID?

This applies here and to other places where the tigher ID bound would make sense.

Comment thread arrow/compute/exprs/types.go Outdated
}

func (e *extensionSet) EncodeTypeVariation(dt arrow.DataType) (extensions.ID, uint32, bool) {
func (e *extensionSet) EncodeTypeVariation(dt arrow.DataType) (extensions.ExtensionID, uint32, bool) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this return an extensions.TypeVariationID?

Comment thread arrow/compute/exprs/types.go Outdated
}

func (e *extensionSet) EncodeType(dt arrow.DataType) (extensions.ID, uint32, bool) {
func (e *extensionSet) EncodeType(dt arrow.DataType) (extensions.ExtensionID, uint32, bool) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this return a extensions.TypeID?

Comment thread arrow/compute/exprs/types.go Outdated

func (e *extensionSet) DecodeTypeArrow(anchor uint32) (extensions.ID, arrow.DataType, bool) {
id, ok := e.DecodeType(anchor)
func (e *extensionSet) DecodeTypeArrow(anchor uint32) (extensions.ExtensionID, arrow.DataType, bool) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to say that this should return a TypeID, but actually it can also return a TypeVariationID based on the code. That actually points to a potential issue.

The given anchor could be both a valid Type or TypeVariation extension as they are numbered indepently, but if both are set we would only ever return the TypeID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants