Skip to content

Commit 72202d2

Browse files
authored
runtime/sam: fix IN with union first operand (#6662)
1 parent d5185d3 commit 72202d2

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

runtime/sam/expr/eval.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func NewIn(sctx *super.Context, elem, container Evaluator) *In {
134134
}
135135

136136
func (i *In) Eval(this super.Value) super.Value {
137-
elem := i.elem.Eval(this)
137+
elem := i.elem.Eval(this).Deunion()
138138
if elem.IsError() {
139139
return elem
140140
}

runtime/ztests/expr/in.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,27 @@ output: |
4141
4242
---
4343

44+
spq: |
45+
values this in [1,2::(int64|null),null,error(0)]
46+
47+
vector: true
48+
49+
input: |
50+
1::(int64|null)
51+
2
52+
null
53+
null::(int64|null)
54+
error(0)
55+
56+
output: |
57+
true
58+
true
59+
null
60+
null
61+
error(0)
62+
63+
---
64+
4465
# Test in expressions on a map constant.
4566
spq: |
4667
const m = |{"a":1,"b":2}|

0 commit comments

Comments
 (0)