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

Function durToString

runtime/vam/expr/cast/string.go:156–168  ·  view source on GitHub ↗
(vec *vector.Int, index []uint32, n uint32)

Source from the content-addressed store, hash-verified

154}
155
156func durToString(vec *vector.Int, index []uint32, n uint32) ([]uint32, []byte) {
157 var bytes []byte
158 offs := []uint32{0}
159 for i := range n {
160 idx := i
161 if index != nil {
162 idx = index[i]
163 }
164 bytes = append(bytes, nano.Duration(vec.Values[idx]).String()...)
165 offs = append(offs, uint32(len(bytes)))
166 }
167 return offs, bytes
168}

Callers 1

castToStringFunction · 0.85

Calls 2

DurationTypeAlias · 0.92
StringMethod · 0.65

Tested by

no test coverage detected