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

Function timeToString

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

Source from the content-addressed store, hash-verified

139}
140
141func timeToString(vec *vector.Int, index []uint32, n uint32) ([]uint32, []byte) {
142 var bytes []byte
143 offs := []uint32{0}
144 for i := range n {
145 idx := i
146 if index != nil {
147 idx = index[i]
148 }
149 s := nano.Ts(vec.Values[idx]).Time().Format(time.RFC3339Nano)
150 bytes = append(bytes, s...)
151 offs = append(offs, uint32(len(bytes)))
152 }
153 return offs, bytes
154}
155
156func durToString(vec *vector.Int, index []uint32, n uint32) ([]uint32, []byte) {
157 var bytes []byte

Callers 1

castToStringFunction · 0.85

Calls 3

TsTypeAlias · 0.92
FormatMethod · 0.45
TimeMethod · 0.45

Tested by

no test coverage detected