Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions runtime/vam/expr/cast/bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions runtime/ztests/expr/cast/bool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ spq: this::bool
vector: true

input: |
true
false
null::bool
null
1
0
24::uint8
Expand All @@ -20,6 +24,10 @@ input: |
"1"

output: |
true
false
null::bool
null::bool
true
false
true
Expand Down