Skip to content

Commit 9bf79bf

Browse files
committed
remove public Collection() function on ExtensionRegistry
1 parent 72716ca commit 9bf79bf

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

expr/expression.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ func ExtendedFromProto(ex *proto.ExtendedExpression, c *extensions.Collection) (
16121612
}
16131613

16141614
func (ex *Extended) ToProto() *proto.ExtendedExpression {
1615-
urns, uris, decls := ex.Extensions.ToProto(ex.reg.Collection())
1615+
urns, uris, decls := ex.reg.ExtensionsToProto()
16161616
refs := make([]*proto.ExpressionReference, len(ex.ReferredExpr))
16171617
for i, ref := range ex.ReferredExpr {
16181618
refs[i] = ref.ToProto()

expr/utils.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/substrait-io/substrait-go/v6/extensions"
77
"github.com/substrait-io/substrait-go/v6/types"
88
proto "github.com/substrait-io/substrait-protobuf/go/substraitpb"
9+
extensionspb "github.com/substrait-io/substrait-protobuf/go/substraitpb/extensions"
910
)
1011

1112
// ExtensionRegistry provides functionality to resolve extension references and handle subquery expressions.
@@ -76,7 +77,7 @@ func (e *ExtensionRegistry) LookupWindowFunction(anchor uint32) (*extensions.Win
7677
return e.Set.LookupWindowFunction(anchor, e.c)
7778
}
7879

79-
// Collection returns the underlying extensions collection.
80-
func (e *ExtensionRegistry) Collection() *extensions.Collection {
81-
return e.c
80+
// ExtensionsToProto returns the URNs, URIs, and declarations from the extension set using the registry's collection.
81+
func (e *ExtensionRegistry) ExtensionsToProto() ([]*extensionspb.SimpleExtensionURN, []*extensionspb.SimpleExtensionURI, []*extensionspb.SimpleExtensionDeclaration) {
82+
return e.Set.ToProto(e.c)
8283
}

plan/plan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func FromProto(plan *proto.Plan, c *extensions.Collection) (*Plan, error) {
233233
}
234234

235235
func (p *Plan) ToProto() (*proto.Plan, error) {
236-
urns, uris, decls := p.extensions.ToProto(p.reg.Collection())
236+
urns, uris, decls := p.reg.ExtensionsToProto()
237237
relations := make([]*proto.PlanRel, len(p.relations))
238238
for i, r := range p.relations {
239239
relations[i] = r.ToProto()

0 commit comments

Comments
 (0)