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

Method Elements

value.go:202–212  ·  view source on GitHub ↗

Elements returns an array of Values for the given container type. Returns an error if the element is not an array or set.

()

Source from the content-addressed store, hash-verified

200// Elements returns an array of Values for the given container type.
201// Returns an error if the element is not an array or set.
202func (v Value) Elements() ([]Value, error) {
203 innerType := InnerType(v.Type())
204 if innerType == nil {
205 return nil, ErrNotContainer
206 }
207 var elements []Value
208 for it := v.ContainerIter(); !it.Done(); {
209 elements = append(elements, NewValue(innerType, it.Next()))
210 }
211 return elements, nil
212}
213
214func (v Value) ContainerLength() (int, error) {
215 switch v.Type().(type) {

Callers 2

fromConstMethod · 0.80
EvalMethod · 0.80

Calls 6

TypeMethod · 0.95
ContainerIterMethod · 0.95
InnerTypeFunction · 0.85
NewValueFunction · 0.85
DoneMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected