Skip to content

Commit

Permalink
collect: untag union values (#4932)
Browse files Browse the repository at this point in the history
Closes #4707
  • Loading branch information
mattnibs authored Dec 19, 2023
1 parent b7d3b41 commit a246bfe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/expr/agg/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (c *Collect) Consume(val *zed.Value) {
}

func (c *Collect) update(val *zed.Value) {
c.values = append(c.values, *val.Copy())
c.values = append(c.values, *val.Under(&zed.Value{}).Copy())
c.size += len(val.Bytes())
for c.size > MaxValueSize {
// XXX See issue #1813. For now we silently discard entries
Expand Down
9 changes: 9 additions & 0 deletions runtime/expr/agg/ztests/collect-untag-unions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
zed: collect(this)

input: |
1((int64,string))
"foo"((time,string))
0.5
output: |
[1,"foo",0.5]

0 comments on commit a246bfe

Please sign in to comment.