Skip to content

Commit

Permalink
Update proto definition to v0.55.0
Browse files Browse the repository at this point in the history
  • Loading branch information
anshuldata committed Aug 19, 2024
1 parent cbd28cb commit 46d6993
Show file tree
Hide file tree
Showing 7 changed files with 4,101 additions and 3,200 deletions.
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.53.0
// Current generated proto substrait version: v0.55.0
package substraitgo

//go:generate buf generate https://github.com/substrait-io/substrait.git#tag=v0.53.0
//go:generate buf generate https://github.com/substrait-io/substrait.git#tag=v0.55.0
8 changes: 4 additions & 4 deletions plan/plan_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,12 @@ func TestJoinRelOutputRecordTypes(t *testing.T) {
recordString string
}{
{"JOIN_TYPE_INNER", plan.JoinTypeInner, []string{"a", "b", "c", "d"}, "NSTRUCT<a: string, b: fp32, c: i32, d: boolean>"},
{"JOIN_TYPE_SEMI", plan.JoinTypeSemi, []string{"a", "b"}, "NSTRUCT<a: string, b: fp32>"},
{"JOIN_TYPE_RIGHT_SEMI", plan.JoinTypeRightSemi, []string{"a", "b"}, "NSTRUCT<a: string, b: fp32>"},
{"JOIN_TYPE_OUTER", plan.JoinTypeOuter, []string{"a", "b", "c", "d"}, "NSTRUCT<a: string?, b: fp32?, c: i32?, d: boolean?>"},
{"JOIN_TYPE_LEFT", plan.JoinTypeLeft, []string{"a", "b", "c", "d"}, "NSTRUCT<a: string, b: fp32, c: i32?, d: boolean?>"},
{"JOIN_TYPE_RIGHT", plan.JoinTypeRight, []string{"a", "b", "c", "d"}, "NSTRUCT<a: string?, b: fp32?, c: i32, d: boolean>"},
{"JOIN_TYPE_ANTI", plan.JoinTypeAnti, []string{"a", "b"}, "NSTRUCT<a: string, b: fp32>"},
{"JOIN_TYPE_SINGLE", plan.JoinTypeSingle, []string{"a", "b", "c", "d"}, "NSTRUCT<a: string, b: fp32, c: i32?, d: boolean?>"},
{"JOIN_TYPE_RIGHT_ANTI", plan.JoinTypeRightAnti, []string{"a", "b"}, "NSTRUCT<a: string, b: fp32>"},
{"JOIN_TYPE_RIGHT_SINGLE", plan.JoinTypeRightSingle, []string{"a", "b", "c", "d"}, "NSTRUCT<a: string, b: fp32, c: i32?, d: boolean?>"},
}

for _, tt := range tests {
Expand Down Expand Up @@ -764,7 +764,7 @@ func TestJoinRelationError(t *testing.T) {
assert.ErrorIs(t, err, substraitgo.ErrInvalidRel)
assert.ErrorContains(t, err, "output mapping index out of range")

_, err = b.JoinRemap(left, right, goodcond, plan.JoinTypeAnti, []int32{2})
_, err = b.JoinRemap(left, right, goodcond, plan.JoinTypeRightAnti, []int32{2})
assert.ErrorIs(t, err, substraitgo.ErrInvalidRel)
assert.ErrorContains(t, err, "output mapping index out of range")

Expand Down
12 changes: 6 additions & 6 deletions plan/relations.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,9 @@ const (
JoinTypeOuter = proto.JoinRel_JOIN_TYPE_OUTER
JoinTypeLeft = proto.JoinRel_JOIN_TYPE_LEFT
JoinTypeRight = proto.JoinRel_JOIN_TYPE_RIGHT
JoinTypeSemi = proto.JoinRel_JOIN_TYPE_SEMI
JoinTypeAnti = proto.JoinRel_JOIN_TYPE_ANTI
JoinTypeSingle = proto.JoinRel_JOIN_TYPE_SINGLE
JoinTypeRightSemi = proto.JoinRel_JOIN_TYPE_RIGHT_SEMI
JoinTypeRightAnti = proto.JoinRel_JOIN_TYPE_RIGHT_ANTI
JoinTypeRightSingle = proto.JoinRel_JOIN_TYPE_RIGHT_SINGLE
)

// JoinRel is a binary Join relational operator representing left-join-right,
Expand All @@ -607,14 +607,14 @@ func (j *JoinRel) RecordType() types.StructType {
switch j.joinType {
case JoinTypeInner:
return j.JoinedRecordType()
case JoinTypeSemi:
case JoinTypeRightSemi:
return j.left.Remap(j.left.RecordType())
case JoinTypeOuter:
typeList = j.JoinedRecordType().Types
for i, t := range typeList {
typeList[i] = t.WithNullability(types.NullabilityNullable)
}
case JoinTypeLeft, JoinTypeSingle:
case JoinTypeLeft, JoinTypeRightSingle:
left := j.left.Remap(j.left.RecordType())
right := j.right.Remap(j.right.RecordType())
typeList = make([]types.Type, 0, len(left.Types)+len(right.Types))
Expand All @@ -630,7 +630,7 @@ func (j *JoinRel) RecordType() types.StructType {
typeList = append(typeList, l.WithNullability(types.NullabilityNullable))
}
typeList = append(typeList, right.Types...)
case JoinTypeAnti:
case JoinTypeRightAnti:
typeList = j.left.RecordType().Types
}

Expand Down
Loading

0 comments on commit 46d6993

Please sign in to comment.