Skip to content

Commit

Permalink
Fix strftime on views
Browse files Browse the repository at this point in the history
Closes #5473
  • Loading branch information
mattnibs committed Nov 23, 2024
1 parent cbb40f5 commit f9c37a0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions runtime/vam/expr/function/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,17 @@ func (s *Strftime) fastPath(fvec *vector.Const, tvec vector.Any) vector.Any {
}

func (s *Strftime) fastPathLoop(f *strftime.Strftime, vec *vector.Int, index []uint32) *vector.String {
if index != nil {
out := vector.NewStringEmpty(uint32(len(index)), vector.NewBoolView(vec.Nulls, index))
for _, i := range index {
s := f.FormatString(nano.Ts(vec.Values[i]).Time())
out.Append(s)
}
return out
}
out := vector.NewStringEmpty(vec.Len(), vec.Nulls)
for i := range vec.Len() {
idx := i
if index != nil {
idx = index[i]
}
s := f.FormatString(nano.Ts(vec.Values[idx]).Time())
s := f.FormatString(nano.Ts(vec.Values[i]).Time())
out.Append(s)
}
return out
Expand Down

0 comments on commit f9c37a0

Please sign in to comment.