From 402bd931a7bd815967ae6b30c13cce831569c41a Mon Sep 17 00:00:00 2001 From: Matthew Nibecker Date: Mon, 30 Sep 2024 11:40:10 -0400 Subject: [PATCH] Fix sort return args (#5310) --- compiler/kernel/vop.go | 6 +----- runtime/vam/op/sort.go | 9 +++------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/compiler/kernel/vop.go b/compiler/kernel/vop.go index c583c5a8c0..e5f79e41a4 100644 --- a/compiler/kernel/vop.go +++ b/compiler/kernel/vop.go @@ -111,11 +111,7 @@ func (b *Builder) compileVamLeaf(o dag.Op, parent vector.Puller) (vector.Puller, } sortExprs = append(sortExprs, samexpr.NewSortEvaluator(k, s.Order)) } - sort, err := vamop.NewSort(b.rctx, parent, sortExprs, o.NullsFirst, o.Reverse, b.resetters) - if err != nil { - return nil, fmt.Errorf("compiling sort: %w", err) - } - return sort, nil + return vamop.NewSort(b.rctx, parent, sortExprs, o.NullsFirst, o.Reverse, b.resetters), nil case *dag.Rename: srcs, dsts, err := b.compileAssignmentsToLvals(o.Args) if err != nil { diff --git a/runtime/vam/op/sort.go b/runtime/vam/op/sort.go index 0337c7b904..7ba19c57af 100644 --- a/runtime/vam/op/sort.go +++ b/runtime/vam/op/sort.go @@ -19,13 +19,10 @@ type Sort struct { samsort *sort.Op } -func NewSort(rctx *runtime.Context, parent vector.Puller, fields []expr.SortEvaluator, nullsFirst, reverse bool, resetter expr.Resetter) (*Sort, error) { +func NewSort(rctx *runtime.Context, parent vector.Puller, fields []expr.SortEvaluator, nullsFirst, reverse bool, resetter expr.Resetter) *Sort { materializer := vam.NewMaterializer(parent) - s, err := sort.New(rctx, materializer, fields, nullsFirst, reverse, resetter) - if err != nil { - return nil, err - } - return &Sort{rctx: rctx, samsort: s}, nil + s := sort.New(rctx, materializer, fields, nullsFirst, reverse, resetter) + return &Sort{rctx: rctx, samsort: s} } func (s *Sort) Pull(done bool) (vector.Any, error) {