Skip to content

Commit f629976

Browse files
authored
vam typeof: Don't deunion incoming values (#6888)
1 parent 5cd4c38 commit f629976

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

runtime/vam/expr/function/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ func (t *TypeOf) Call(args ...vector.Any) vector.Any {
156156
return vector.NewConstType(t.sctx, args[0].Type(), args[0].Len())
157157
}
158158

159+
func (t *TypeOf) RipUnions() bool { return false }
160+
159161
type TypeName struct {
160162
sctx *super.Context
161163
}

runtime/ztests/expr/function/typeof.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ input: |
88
{info:"Connection Example",src:{addr:10.1.1.2,port:80},dst:{addr:10.0.1.2,port:20130}}::conn
99
{info:"Connection Example 2",src:{addr:10.1.1.8,port:80},dst:{addr:10.1.2.88,port:19801}}::conn
1010
null
11+
1::(int64|string)
1112
type access_list={info:string,nets:[net]}
1213
{info:"Access List Example",nets:[10.1.1.0/24,10.1.2.0/24]}::access_list
1314
{metric:"A",ts:2020-11-24T16:44:09.586441Z,value:120}
@@ -21,6 +22,7 @@ output: |
2122
<conn>
2223
<conn>
2324
<null>
25+
<int64|string>
2426
type access_list={info:string,nets:[net]}
2527
<access_list>
2628
<{metric:string,ts:time,value:int64}>

0 commit comments

Comments
 (0)