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

Method Call

runtime/vam/expr/function/time.go:106–122  ·  view source on GitHub ↗
(args ...vector.Any)

Source from the content-addressed store, hash-verified

104}
105
106func (s *Strftime) Call(args ...vector.Any) vector.Any {
107 if vec, ok := expr.CheckForNullThenError(args); ok {
108 return vec
109 }
110 args = underAll(args)
111 formatVec, timeVec := args[0], args[1]
112 if formatVec.Type().ID() != super.IDString {
113 return vector.NewWrappedError(s.sctx, "strftime: string value required for format arg", formatVec)
114 }
115 if timeVec.Type().ID() != super.IDTime {
116 return vector.NewWrappedError(s.sctx, "strftime: time value required for time arg", args[1])
117 }
118 if _, ok := formatVec.(*vector.Const); ok {
119 return s.fastPath(formatVec, timeVec)
120 }
121 return s.slowPath(formatVec, timeVec)
122}
123
124func (s *Strftime) fastPath(fvec vector.Any, tvec vector.Any) vector.Any {
125 format := vector.StringValue(fvec, 0)

Callers

nothing calls this directly

Calls 7

fastPathMethod · 0.95
slowPathMethod · 0.95
CheckForNullThenErrorFunction · 0.92
NewWrappedErrorFunction · 0.92
underAllFunction · 0.70
IDMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected