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

Function rip

vector/apply.go:64–82  ·  view source on GitHub ↗
(vecs []Any, d *Dynamic)

Source from the content-addressed store, hash-verified

62}
63
64func rip(vecs []Any, d *Dynamic) iter.Seq2[int, []Any] {
65 return func(yield func(int, []Any) bool) {
66 for i, rev := range d.ReverseTagMap() {
67 var newVecs []Any
68 if len(rev) > 0 {
69 for _, vec := range vecs {
70 if vec == d {
71 newVecs = append(newVecs, d.Values[i])
72 } else {
73 newVecs = append(newVecs, Pick(vec, rev))
74 }
75 }
76 }
77 if !yield(i, newVecs) {
78 return
79 }
80 }
81 }
82}
83
84// stitch returns a Dynamic for tags and vecs. If vecs contains any Dynamics,
85// stitch flattens them and returns a value containing no nested Dynamics.

Callers 1

ApplyFunction · 0.85

Calls 2

PickFunction · 0.85
ReverseTagMapMethod · 0.80

Tested by

no test coverage detected