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

Function viewForUnionOrDynamic

vector/pick.go:48–61  ·  view source on GitHub ↗
(index, tags, forward []uint32, values []Any)

Source from the content-addressed store, hash-verified

46}
47
48func viewForUnionOrDynamic(index, tags, forward []uint32, values []Any) ([]uint32, []Any) {
49 indexes := make([][]uint32, len(values))
50 resultTags := make([]uint32, len(index))
51 for k, index := range index {
52 tag := tags[index]
53 indexes[tag] = append(indexes[tag], forward[index])
54 resultTags[k] = tag
55 }
56 results := make([]Any, len(values))
57 for k := range results {
58 results[k] = Pick(values[k], indexes[k])
59 }
60 return resultTags, results
61}
62
63// ReversePick is like Pick but it builds the vector from the elements
64// that are not in the index maintaining the element order of vec.

Callers 1

PickFunction · 0.85

Calls 1

PickFunction · 0.85

Tested by

no test coverage detected