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

Method slowPath

runtime/vam/expr/function/time.go:164–188  ·  view source on GitHub ↗
(fvec vector.Any, tvec vector.Any)

Source from the content-addressed store, hash-verified

162}
163
164func (s *Strftime) slowPath(fvec vector.Any, tvec vector.Any) vector.Any {
165 var f *strftime.Strftime
166 var errIndex []uint32
167 errMsgs := vector.NewStringEmpty(0)
168 out := vector.NewStringEmpty(0)
169 for i := range fvec.Len() {
170 format := vector.StringValue(fvec, i)
171 if f == nil || f.Pattern() != format {
172 var err error
173 f, err = strftime.New(format)
174 if err != nil {
175 errIndex = append(errIndex, i)
176 errMsgs.Append("strftime: " + err.Error())
177 continue
178 }
179 }
180 t := vector.IntValue(tvec, i)
181 out.Append(f.FormatString(nano.Ts(t).Time()))
182 }
183 if len(errIndex) > 0 {
184 errVec := vector.NewVecWrappedError(s.sctx, errMsgs, vector.Pick(fvec, errIndex))
185 return vector.Combine(out, errIndex, errVec)
186 }
187 return out
188}

Callers 1

CallMethod · 0.95

Calls 12

NewStringEmptyFunction · 0.92
StringValueFunction · 0.92
IntValueFunction · 0.92
TsTypeAlias · 0.92
NewVecWrappedErrorFunction · 0.92
PickFunction · 0.92
CombineFunction · 0.92
NewMethod · 0.80
LenMethod · 0.65
AppendMethod · 0.45
ErrorMethod · 0.45
TimeMethod · 0.45

Tested by

no test coverage detected