MCPcopy Create free account
hub / github.com/brimdata/super / NewUnionEncoder

Function NewUnionEncoder

csup/union.go:20–29  ·  view source on GitHub ↗
(cctx *Context, typ *super.TypeUnion)

Source from the content-addressed store, hash-verified

18var _ Encoder = (*UnionEncoder)(nil)
19
20func NewUnionEncoder(cctx *Context, typ *super.TypeUnion) *UnionEncoder {
21 var values []Encoder
22 for _, typ := range typ.Types {
23 values = append(values, NewEncoder(cctx, typ))
24 }
25 return &UnionEncoder{
26 typ: typ,
27 values: values,
28 }
29}
30
31func (u *UnionEncoder) Write(vec vector.Any) {
32 if vec.Len() == 0 {

Callers 1

NewEncoderFunction · 0.85

Calls 1

NewEncoderFunction · 0.70

Tested by

no test coverage detected