Skip to content

Commit

Permalink
Fix strftime on views (#5498)
Browse files Browse the repository at this point in the history
Closes #5473, #5469
  • Loading branch information
mattnibs authored Nov 25, 2024
1 parent cbb40f5 commit 62d0639
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 62d0639

Please sign in to comment.