diff --git a/runtime/vam/expr/cast/bool.go b/runtime/vam/expr/cast/bool.go index e2404d125..6c44c1ccc 100644 --- a/runtime/vam/expr/cast/bool.go +++ b/runtime/vam/expr/cast/bool.go @@ -15,6 +15,12 @@ func castToBool(vec vector.Any, index []uint32) (vector.Any, []uint32, string, b out = numberToBool(vec.Values, index) case *vector.Float: out = numberToBool(vec.Values, index) + case *vector.Bool: + out := vector.Any(vec) + if index != nil { + out = vector.Pick(out, index) + } + return out, nil, "", true case *vector.String: vvec, errs := stringToBool(vec, index) return vvec, errs, "", true diff --git a/runtime/ztests/expr/cast/bool.yaml b/runtime/ztests/expr/cast/bool.yaml index 5315df1a3..a270ec717 100644 --- a/runtime/ztests/expr/cast/bool.yaml +++ b/runtime/ztests/expr/cast/bool.yaml @@ -3,6 +3,10 @@ spq: this::bool vector: true input: | + true + false + null::bool + null 1 0 24::uint8 @@ -20,6 +24,10 @@ input: | "1" output: | + true + false + null::bool + null::bool true false true