diff --git a/runtime/vam/expr/arith.go b/runtime/vam/expr/arith.go index 59c65db48d..71437894a3 100644 --- a/runtime/vam/expr/arith.go +++ b/runtime/vam/expr/arith.go @@ -63,7 +63,9 @@ func (a *Arith) eval(vecs ...vector.Any) (out vector.Any) { } }() } - return f(lhs, rhs) + out = f(lhs, rhs) + vector.SetNulls(out, vector.Or(vector.NullsOf(lhs), vector.NullsOf(rhs))) + return out } func (a *Arith) evalDivideByZero(kind vector.Kind, lhs, rhs vector.Any) vector.Any { diff --git a/runtime/vam/expr/arithfuncs.go b/runtime/vam/expr/arithfuncs.go index c3fef5965c..1df7c9709a 100644 --- a/runtime/vam/expr/arithfuncs.go +++ b/runtime/vam/expr/arithfuncs.go @@ -38,7 +38,7 @@ func arithAddIntFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -97,7 +97,7 @@ func arithAddIntDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -126,7 +126,7 @@ func arithAddIntViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Int) lx := ld.Index r := rhs.(*vector.Int) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -142,7 +142,7 @@ func arithAddIntViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -158,7 +158,7 @@ func arithAddIntViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -173,7 +173,7 @@ func arithAddIntViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsInt() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -216,7 +216,7 @@ func arithAddIntConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -266,7 +266,7 @@ func arithAddUintFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -325,7 +325,7 @@ func arithAddUintDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -354,7 +354,7 @@ func arithAddUintViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Uint) lx := ld.Index r := rhs.(*vector.Uint) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -370,7 +370,7 @@ func arithAddUintViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -386,7 +386,7 @@ func arithAddUintViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -401,7 +401,7 @@ func arithAddUintViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsUint() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -444,7 +444,7 @@ func arithAddUintConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -494,7 +494,7 @@ func arithAddFloatFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -553,7 +553,7 @@ func arithAddFloatDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -582,7 +582,7 @@ func arithAddFloatViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Float) lx := ld.Index r := rhs.(*vector.Float) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -598,7 +598,7 @@ func arithAddFloatViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -614,7 +614,7 @@ func arithAddFloatViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -629,7 +629,7 @@ func arithAddFloatViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsFloat() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -672,7 +672,7 @@ func arithAddFloatConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -722,7 +722,7 @@ func arithAddStringFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.String) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewStringEmpty(n, nulls) for k := uint32(0); k < n; k++ { @@ -781,7 +781,7 @@ func arithAddStringDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.String) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewStringEmpty(n, nulls) for k := uint32(0); k < n; k++ { @@ -810,7 +810,7 @@ func arithAddStringViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.String) lx := ld.Index r := rhs.(*vector.String) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewStringEmpty(n, nulls) for k := uint32(0); k < n; k++ { @@ -826,7 +826,7 @@ func arithAddStringViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.String) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewStringEmpty(n, nulls) for k := uint32(0); k < n; k++ { @@ -842,7 +842,7 @@ func arithAddStringViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.String) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewStringEmpty(n, nulls) for k := uint32(0); k < n; k++ { @@ -857,7 +857,7 @@ func arithAddStringViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsString() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewStringEmpty(n, nulls) for k := uint32(0); k < n; k++ { @@ -900,7 +900,7 @@ func arithAddStringConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.String) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewStringEmpty(n, nulls) for k := uint32(0); k < n; k++ { @@ -950,7 +950,7 @@ func arithSubIntFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1009,7 +1009,7 @@ func arithSubIntDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1038,7 +1038,7 @@ func arithSubIntViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Int) lx := ld.Index r := rhs.(*vector.Int) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1054,7 +1054,7 @@ func arithSubIntViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1070,7 +1070,7 @@ func arithSubIntViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1085,7 +1085,7 @@ func arithSubIntViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsInt() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1128,7 +1128,7 @@ func arithSubIntConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1178,7 +1178,7 @@ func arithSubUintFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1237,7 +1237,7 @@ func arithSubUintDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1266,7 +1266,7 @@ func arithSubUintViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Uint) lx := ld.Index r := rhs.(*vector.Uint) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1282,7 +1282,7 @@ func arithSubUintViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1298,7 +1298,7 @@ func arithSubUintViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1313,7 +1313,7 @@ func arithSubUintViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsUint() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1356,7 +1356,7 @@ func arithSubUintConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1406,7 +1406,7 @@ func arithSubFloatFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1465,7 +1465,7 @@ func arithSubFloatDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1494,7 +1494,7 @@ func arithSubFloatViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Float) lx := ld.Index r := rhs.(*vector.Float) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1510,7 +1510,7 @@ func arithSubFloatViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1526,7 +1526,7 @@ func arithSubFloatViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1541,7 +1541,7 @@ func arithSubFloatViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsFloat() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1584,7 +1584,7 @@ func arithSubFloatConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1634,7 +1634,7 @@ func arithMulIntFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1693,7 +1693,7 @@ func arithMulIntDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1722,7 +1722,7 @@ func arithMulIntViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Int) lx := ld.Index r := rhs.(*vector.Int) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1738,7 +1738,7 @@ func arithMulIntViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1754,7 +1754,7 @@ func arithMulIntViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1769,7 +1769,7 @@ func arithMulIntViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsInt() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1812,7 +1812,7 @@ func arithMulIntConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1862,7 +1862,7 @@ func arithMulUintFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1921,7 +1921,7 @@ func arithMulUintDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1950,7 +1950,7 @@ func arithMulUintViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Uint) lx := ld.Index r := rhs.(*vector.Uint) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1966,7 +1966,7 @@ func arithMulUintViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1982,7 +1982,7 @@ func arithMulUintViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -1997,7 +1997,7 @@ func arithMulUintViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsUint() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2040,7 +2040,7 @@ func arithMulUintConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2090,7 +2090,7 @@ func arithMulFloatFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2149,7 +2149,7 @@ func arithMulFloatDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2178,7 +2178,7 @@ func arithMulFloatViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Float) lx := ld.Index r := rhs.(*vector.Float) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2194,7 +2194,7 @@ func arithMulFloatViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2210,7 +2210,7 @@ func arithMulFloatViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2225,7 +2225,7 @@ func arithMulFloatViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsFloat() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2268,7 +2268,7 @@ func arithMulFloatConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2318,7 +2318,7 @@ func arithDivIntFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2377,7 +2377,7 @@ func arithDivIntDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2406,7 +2406,7 @@ func arithDivIntViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Int) lx := ld.Index r := rhs.(*vector.Int) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2422,7 +2422,7 @@ func arithDivIntViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2438,7 +2438,7 @@ func arithDivIntViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2453,7 +2453,7 @@ func arithDivIntViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsInt() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2496,7 +2496,7 @@ func arithDivIntConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2546,7 +2546,7 @@ func arithDivUintFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2605,7 +2605,7 @@ func arithDivUintDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2634,7 +2634,7 @@ func arithDivUintViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Uint) lx := ld.Index r := rhs.(*vector.Uint) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2650,7 +2650,7 @@ func arithDivUintViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2666,7 +2666,7 @@ func arithDivUintViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2681,7 +2681,7 @@ func arithDivUintViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsUint() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2724,7 +2724,7 @@ func arithDivUintConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2774,7 +2774,7 @@ func arithDivFloatFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2833,7 +2833,7 @@ func arithDivFloatDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2862,7 +2862,7 @@ func arithDivFloatViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Float) lx := ld.Index r := rhs.(*vector.Float) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2878,7 +2878,7 @@ func arithDivFloatViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2894,7 +2894,7 @@ func arithDivFloatViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2909,7 +2909,7 @@ func arithDivFloatViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsFloat() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -2952,7 +2952,7 @@ func arithDivFloatConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Float) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewFloatEmpty(super.TypeFloat64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3002,7 +3002,7 @@ func arithModIntFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3061,7 +3061,7 @@ func arithModIntDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3090,7 +3090,7 @@ func arithModIntViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Int) lx := ld.Index r := rhs.(*vector.Int) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3106,7 +3106,7 @@ func arithModIntViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3122,7 +3122,7 @@ func arithModIntViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3137,7 +3137,7 @@ func arithModIntViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsInt() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3180,7 +3180,7 @@ func arithModIntConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Int) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewIntEmpty(super.TypeInt64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3230,7 +3230,7 @@ func arithModUintFlatView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3289,7 +3289,7 @@ func arithModUintDictView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3318,7 +3318,7 @@ func arithModUintViewFlat(lhs, rhs vector.Any) vector.Any { l := ld.Any.(*vector.Uint) lx := ld.Index r := rhs.(*vector.Uint) - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3334,7 +3334,7 @@ func arithModUintViewDict(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.Dict) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3350,7 +3350,7 @@ func arithModUintViewView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3365,7 +3365,7 @@ func arithModUintViewConst(lhs, rhs vector.Any) vector.Any { lx := ld.Index r := rhs.(*vector.Const) rconst, _ := r.AsUint() - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(vector.BoolView(l.Nulls, ld.Index), r.Nulls) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { @@ -3408,7 +3408,7 @@ func arithModUintConstView(lhs, rhs vector.Any) vector.Any { rd := rhs.(*vector.View) r := rd.Any.(*vector.Uint) rx := rd.Index - nulls := vector.Or(l.Nulls, r.Nulls) + nulls := vector.Or(l.Nulls, vector.BoolView(r.Nulls, rd.Index)) n := lhs.Len() out := vector.NewUintEmpty(super.TypeUint64, n, nulls) for k := uint32(0); k < n; k++ { diff --git a/runtime/vam/expr/cast/bool.go b/runtime/vam/expr/cast/bool.go index 34b6efac99..5c6b8d63d2 100644 --- a/runtime/vam/expr/cast/bool.go +++ b/runtime/vam/expr/cast/bool.go @@ -22,7 +22,7 @@ func castToBool(vec vector.Any, index []uint32) (vector.Any, []uint32, bool) { } out.Nulls = vector.NullsOf(vec) if index != nil { - out.Nulls = vector.NullsView(out.Nulls, index) + out.Nulls = vector.BoolView(out.Nulls, index) } return out, nil, true } diff --git a/runtime/vam/expr/cast/bytes.go b/runtime/vam/expr/cast/bytes.go index 483b4d4018..6516c52928 100644 --- a/runtime/vam/expr/cast/bytes.go +++ b/runtime/vam/expr/cast/bytes.go @@ -9,7 +9,7 @@ func castToBytes(vec vector.Any, index []uint32) (vector.Any, []uint32, bool) { n := lengthOf(vec, index) nulls := vector.NullsOf(vec) if index != nil { - nulls = vector.NullsView(nulls, index) + nulls = vector.BoolView(nulls, index) } out := vector.NewBytesEmpty(n, nulls) var b zcode.Builder diff --git a/runtime/vam/expr/cast/number.go b/runtime/vam/expr/cast/number.go index 10a6f9a604..9e72b92b0d 100644 --- a/runtime/vam/expr/cast/number.go +++ b/runtime/vam/expr/cast/number.go @@ -26,19 +26,19 @@ func castToNumber(vec vector.Any, typ super.Type, index []uint32) (vector.Any, [ case super.IsSigned(id): vals, errs := toNumeric[int64](vec, typ, index) if len(errs) > 0 { - nulls = vector.NullsView(nulls, inverseIndex(errs, nulls)) + nulls = vector.BoolView(nulls, inverseIndex(errs, nulls)) } return vector.NewInt(typ, vals, nulls), errs, true case super.IsUnsigned(id): vals, errs := toNumeric[uint64](vec, typ, index) if len(errs) > 0 { - nulls = vector.NullsView(nulls, inverseIndex(errs, nulls)) + nulls = vector.BoolView(nulls, inverseIndex(errs, nulls)) } return vector.NewUint(typ, vals, nulls), errs, true case super.IsFloat(id): vals, errs := toNumeric[float64](vec, typ, index) if errs != nil { - nulls = vector.NullsView(nulls, inverseIndex(errs, nulls)) + nulls = vector.BoolView(nulls, inverseIndex(errs, nulls)) } return vector.NewFloat(typ, vals, nulls), errs, true default: diff --git a/runtime/vam/expr/cast/string.go b/runtime/vam/expr/cast/string.go index bad969fff4..c78764eace 100644 --- a/runtime/vam/expr/cast/string.go +++ b/runtime/vam/expr/cast/string.go @@ -14,7 +14,7 @@ import ( func castToString(vec vector.Any, index []uint32) (vector.Any, []uint32, bool) { nulls := vector.NullsOf(vec) if index != nil { - nulls = vector.NullsView(nulls, index) + nulls = vector.BoolView(nulls, index) } n := lengthOf(vec, index) var bytes []byte diff --git a/runtime/vam/expr/genarithfuncs.go b/runtime/vam/expr/genarithfuncs.go index afe6bee2fc..7c38f9cd0b 100644 --- a/runtime/vam/expr/genarithfuncs.go +++ b/runtime/vam/expr/genarithfuncs.go @@ -71,7 +71,6 @@ func genFunc(name, op, typ string, lhs, rhs vector.Form) string { s := fmt.Sprintf("func %s(lhs, rhs vector.Any) vector.Any {\n", name) s += genVarInit("l", typ, lhs) s += genVarInit("r", typ, rhs) - s += "nulls := vector.Or(l.Nulls, r.Nulls)\n" if lhs == vector.FormConst && rhs == vector.FormConst { if typ == "String" { s += fmt.Sprintf("val := super.NewString(lconst %s rconst)\n", op) diff --git a/vector/bool.go b/vector/bool.go index 96c6203061..2721703215 100644 --- a/vector/bool.go +++ b/vector/bool.go @@ -174,7 +174,7 @@ func NullsOf(v Any) *Bool { case *Union: return v.Nulls case *View: - return NullsView(NullsOf(v.Any), v.Index) + return BoolView(NullsOf(v.Any), v.Index) } panic(v) } diff --git a/vector/view.go b/vector/view.go index 6b450d3e8a..e42a309b8b 100644 --- a/vector/view.go +++ b/vector/view.go @@ -13,8 +13,10 @@ var _ Any = (*View)(nil) func NewView(val Any, index []uint32) Any { switch val := val.(type) { + case *Bool: + return BoolView(val, index) case *Const: - return NewConst(val.val, uint32(len(index)), NullsView(val.Nulls, index)) + return NewConst(val.val, uint32(len(index)), BoolView(val.Nulls, index)) case *Dict: index2 := make([]byte, len(index)) var nulls *Bool @@ -33,10 +35,10 @@ func NewView(val Any, index []uint32) Any { } return NewDict(val.Any, index2, nil, nulls) case *Error: - return NewError(val.Typ, NewView(val.Vals, index), NullsView(val.Nulls, index)) + return NewError(val.Typ, NewView(val.Vals, index), BoolView(val.Nulls, index)) case *Union: tags, values := viewForUnionOrDynamic(index, val.Tags, val.TagMap.Forward, val.Values) - return NewUnion(val.Typ, tags, values, NullsView(val.Nulls, index)) + return NewUnion(val.Typ, tags, values, BoolView(val.Nulls, index)) case *Dynamic: return NewDynamic(viewForUnionOrDynamic(index, val.Tags, val.TagMap.Forward, val.Values)) case *View: @@ -52,19 +54,19 @@ func NewView(val Any, index []uint32) Any { return &View{val, index} } -func NullsView(nulls *Bool, index []uint32) *Bool { - if nulls == nil { +func BoolView(vec *Bool, index []uint32) *Bool { + if vec == nil { return nil } - var out *Bool + out := NewBoolEmpty(uint32(len(index)), nil) for k, slot := range index { - if nulls.Value(slot) { - if out == nil { - out = NewBoolEmpty(uint32(len(index)), nil) - } + if vec.Value(slot) { out.Set(uint32(k)) } } + if vec.Nulls != nil { + out.Nulls = BoolView(vec.Nulls, index) + } return out }