Skip to content

Commit

Permalink
sort by timestamp before writing
Browse files Browse the repository at this point in the history
  • Loading branch information
gernest committed Feb 22, 2024
1 parent b15b6a1 commit 12ca2b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/closter/events/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ func (b *Builder) Release() {

func (b *Builder) Write(list *v1.List) arrow.Record {
ls := list.GetItems()
sort.Slice(ls, func(i, j int) bool {
return ls[i].Timestamp < ls[j].Timestamp
})
b.r.Reserve(len(ls))
for _, e := range ls {
b.writeData(e)
Expand Down

0 comments on commit 12ca2b9

Please sign in to comment.