From 08fc271c4191593a7e1d050061b21f3db792b079 Mon Sep 17 00:00:00 2001 From: Matthew Nibecker Date: Tue, 15 Aug 2023 18:00:37 -0400 Subject: [PATCH] Fix nullsMax in groupby (#4753) Update the groupby proc to make nulls the max value. Closes #4709 --- runtime/op/groupby/groupby.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/runtime/op/groupby/groupby.go b/runtime/op/groupby/groupby.go index 622f07d0eb..1b3a5d8895 100644 --- a/runtime/op/groupby/groupby.go +++ b/runtime/op/groupby/groupby.go @@ -77,11 +77,7 @@ func NewAggregator(ctx context.Context, zctx *zed.Context, keyRefs, keyExprs, ag var keyCompare, valueCompare expr.CompareFn nkeys := len(keyExprs) if nkeys > 0 && inputDir != 0 { - // As the default sort behavior, nullsMax=true for ascending order and - // nullsMax=false for descending order is also expected for streaming - // groupby. - nullsMax := inputDir > 0 - valueCompare = expr.NewValueCompareFn(order.Which(inputDir < 0), nullsMax) + valueCompare = expr.NewValueCompareFn(order.Which(inputDir < 0), true) rs := expr.NewCompareFn(true, keyRefs[0]) if inputDir < 0 { keyCompare = func(a, b *zed.Value) int { return rs(b, a) }