Files
Martin DisibioandGitHub 8e57f1972c vParquet5 Preview 1 - low resolution timestamp columns (#5495)
* Experiments with next parquet version. Added rounded start time column

* Vparquet5 use lower precision timestamp column when possible based on step interval

* microoptimization

* leftjoiniterator use dynamic branch reordering, plus other performance improvements

* Add columns with other granularities

* Add new functionality: nocompactflg and short trace ID search

* Fix handling of large step intervals and split between backend and generator requests

* Repair tests and reduce divergence from main

* Cleanup, separate benchmark env vars

* Set version string to preview

* rename/comments

* Oops undo change to default encoding

* Fix tests and lint

* Bring in more updates from vparquet4

* Improve accuracy of estimate function, cleanup debug statements

* Reduce diff from main

* lint

* Add test parquet file

* Fix to maintain nano-second precision for blocks overlapping query range edges and recent/backend handoff where things don't align

* Fix tests after merging main, one more fix to maintain nanosecond precision when needed

* changelog

* Cleanup/reduce diff from main

* Review feedback
2025-08-18 15:06:58 -04:00

49 lines
864 B
Go

package vparquet5
import (
"bytes"
"encoding/json"
"sort"
"github.com/grafana/tempo/tempodb/encoding/common"
)
type index struct {
lastID common.ID
dirty bool
RowGroups []common.ID `json:"rowGroups"`
}
func (i *index) Add(id common.ID) {
i.lastID = id
i.dirty = true
}
func (i *index) Flush() {
if i.dirty {
i.RowGroups = append(i.RowGroups, i.lastID)
i.dirty = false
}
}
func (i *index) Marshal() ([]byte, error) {
return json.Marshal(i)
}
func (i *index) Find(id common.ID) int {
n := sort.Search(len(i.RowGroups), func(j int) bool {
return bytes.Compare(id, i.RowGroups[j]) <= 0
})
if n >= len(i.RowGroups) {
// Beyond the last row group. This is the only
// area where presence can be ruled out.
return -1
}
return n
}
func unmarshalIndex(b []byte) (*index, error) {
i := &index{}
return i, json.Unmarshal(b, i)
}