MCPcopy
hub / github.com/grafana/tempo / seekRowGroup

Method seekRowGroup

pkg/parquetquery/iters.go:641–669  ·  view source on GitHub ↗

seekRowGroup skips ahead to the row group that could contain the value at the desired row number. Does nothing if the current row group is already the correct one.

(seekTo RowNumber, definitionLevel int)

Source from the content-addressed store, hash-verified

639// seekRowGroup skips ahead to the row group that could contain the value at the
640// desired row number. Does nothing if the current row group is already the correct one.
641func (c *SyncIterator) seekRowGroup(seekTo RowNumber, definitionLevel int) (done bool) {
642 if c.currRowGroup != nil && CompareRowNumbers(definitionLevel, seekTo, c.currRowGroupMax) >= 0 {
643 // Done with this row group
644 c.closeCurrRowGroup()
645 }
646
647 for c.currRowGroup == nil {
648
649 rg, minRN, maxRN := c.popRowGroup()
650 if rg == nil {
651 return true
652 }
653
654 if CompareRowNumbers(definitionLevel, seekTo, maxRN) != -1 {
655 continue
656 }
657
658 cc := &ColumnChunkHelper{ColumnChunk: rg.ColumnChunks()[c.column]}
659 if c.filter != nil && !c.filter.KeepColumnChunk(cc) {
660 cc.Close()
661 continue
662 }
663
664 // This row group matches both row number and filter.
665 c.setRowGroup(rg, minRN, maxRN, cc)
666 }
667
668 return c.currRowGroup == nil
669}
670
671// seekPages skips ahead in the current row group to the page that could contain the value at
672// the desired row number. Does nothing if the current page is already the correct one.

Callers 2

SeekToMethod · 0.95
SeekToMethod · 0.80

Calls 6

closeCurrRowGroupMethod · 0.95
popRowGroupMethod · 0.95
CloseMethod · 0.95
setRowGroupMethod · 0.95
CompareRowNumbersFunction · 0.85
KeepColumnChunkMethod · 0.65

Tested by

no test coverage detected