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

Method encodeTypeUnion

sio/bsupio/types.go:119–135  ·  view source on GitHub ↗
(ext *super.TypeUnion)

Source from the content-addressed store, hash-verified

117}
118
119func (e *Encoder) encodeTypeUnion(ext *super.TypeUnion) (super.Type, error) {
120 var types []super.Type
121 for _, t := range ext.Types {
122 t, err := e.Encode(t)
123 if err != nil {
124 return nil, err
125 }
126 types = append(types, t)
127 }
128 typ := e.sctx.LookupTypeUnion(types)
129 e.bytes = append(e.bytes, TypeDefUnion)
130 e.bytes = binary.AppendUvarint(e.bytes, uint64(len(types)))
131 for _, t := range types {
132 e.bytes = binary.AppendUvarint(e.bytes, uint64(super.TypeID(t)))
133 }
134 return typ, nil
135}
136
137func (e *Encoder) encodeTypeSet(ext *super.TypeSet) (*super.TypeSet, error) {
138 inner, err := e.Encode(ext.Type)

Callers 1

encodeMethod · 0.95

Implementers 10

FusionEncodercsup/fusion.go
RecordEncodercsup/record.go
FloatEncodercsup/float.go
IntEncodercsup/int.go
UintEncodercsup/int.go
UnionEncodercsup/union.go
ArrayEncodercsup/array.go
ScodeEncodercsup/scode.go
MapEncodercsup/map.go
BytesEncodercsup/bytes.go

Calls 3

EncodeMethod · 0.95
TypeIDFunction · 0.92
LookupTypeUnionMethod · 0.80

Tested by

no test coverage detected