Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(substrait) Update to substrait v0.64.0 #105

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Package substraitgo contains the experimental go bindings for substrait
// (https://substrait.io).
//
// Current generated proto substrait version: v0.55.0
// Current generated proto substrait version: v0.64.0
package substraitgo

//go:generate buf generate https://github.com/substrait-io/substrait.git#tag=v0.59.0
//go:generate buf generate https://github.com/substrait-io/substrait.git#tag=v0.64.0
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/substrait-io/substrait v0.63.1 h1:XNPvrEYNPjDqenK4TxqBDDUNzglafdjzjejzQqEwk5Y=
github.com/substrait-io/substrait v0.63.1/go.mod h1:MPFNw6sToJgpD5Z2rj0rQrdP/Oq8HG7Z2t3CAEHtkHw=
github.com/substrait-io/substrait-go v1.2.0 h1:3ZNRkc8FYD7ifCagKEOZQtUcgMceMQfwo2N1NGaK4Q4=
github.com/substrait-io/substrait-go v1.2.0/go.mod h1:IPsy24rdjp/buXR+T8ENl6QCnSCS6h+uM8P+GaZez7c=
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY=
golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
Expand Down
18 changes: 16 additions & 2 deletions plan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,24 @@
return nil, fmt.Errorf("error getting input to FetchRel: %w", err)
}

var offset int64
if off, ok := rel.Fetch.OffsetMode.(*proto.FetchRel_Offset); ok {
Copy link
Member

Choose a reason for hiding this comment

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

It'd be useful to have tests that show we can work with both the new and old way of specifying FetchRel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@EpsilonPrime I wanted to defer adding the new way to a separate PR. This PR should be only update to new version and no change to functionality. Is that fine? Thanks

offset = off.Offset
} else {
return nil, fmt.Errorf("%w: missing required Offset field for Fetch Relation", substraitgo.ErrInvalidRel)
}

Check warning on line 419 in plan/plan.go

View check run for this annotation

Codecov / codecov/patch

plan/plan.go#L418-L419

Added lines #L418 - L419 were not covered by tests

var count int64
if cnt, ok := rel.Fetch.CountMode.(*proto.FetchRel_Count); ok {
count = cnt.Count
} else {
return nil, fmt.Errorf("%w: missing required Count field for Fetch Relation", substraitgo.ErrInvalidRel)
}

Check warning on line 426 in plan/plan.go

View check run for this annotation

Codecov / codecov/patch

plan/plan.go#L425-L426

Added lines #L425 - L426 were not covered by tests

out := &FetchRel{
input: input,
offset: rel.Fetch.Offset,
count: rel.Fetch.Count,
offset: offset,
count: count,
advExtension: rel.Fetch.AdvancedExtension,
}
if rel.Fetch.Common != nil {
Expand Down
12 changes: 8 additions & 4 deletions plan/relations.go
Original file line number Diff line number Diff line change
Expand Up @@ -897,10 +897,14 @@ func (f *FetchRel) ToProto() *proto.Rel {
return &proto.Rel{
RelType: &proto.Rel_Fetch{
Fetch: &proto.FetchRel{
Common: f.toProto(),
Input: f.input.ToProto(),
Offset: f.offset,
Count: f.count,
Common: f.toProto(),
Input: f.input.ToProto(),
OffsetMode: &proto.FetchRel_Offset{
Offset: f.offset,
},
CountMode: &proto.FetchRel_Count{
Count: f.count,
},
AdvancedExtension: f.advExtension,
},
},
Expand Down
Loading
Loading