From 47929ee9b67bd63a70b643ab1e11665195e96557 Mon Sep 17 00:00:00 2001 From: Matthew Nibecker Date: Tue, 1 Oct 2024 18:08:33 -0400 Subject: [PATCH] Update vector/view.go Co-authored-by: Noah Treuhaft --- vector/view.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vector/view.go b/vector/view.go index a8596af83f..a90332dd7e 100644 --- a/vector/view.go +++ b/vector/view.go @@ -46,16 +46,16 @@ func nullsView(nulls *Bool, index []uint32) *Bool { if nulls == nil { return nil } - out := NewBoolEmpty(uint32(len(index)), nil) + var out *vector.Bool for k, slot := range index { if nulls.Value(slot) { + if out == nil { + out = NewBoolEmpty(uint32(len(index)), nil) + } out.Set(uint32(k)) } } - if out.Len() > 0 { - return out - } - return nil + return out } func viewForUnionOrDynamic(index, tags, forward []uint32, values []Any) ([]uint32, []Any) {