SeekTo moves this iterator to the next result that is greater than or equal to the given row number (and based on the given definition level)
(to RowNumber, definitionLevel int)
| 585 | // SeekTo moves this iterator to the next result that is greater than |
| 586 | // or equal to the given row number (and based on the given definition level) |
| 587 | func (c *SyncIterator) SeekTo(to RowNumber, definitionLevel int) (*IteratorResult, error) { |
| 588 | for { |
| 589 | if done := c.seekRowGroup(to, definitionLevel); done { |
| 590 | return nil, nil |
| 591 | } |
| 592 | |
| 593 | done, err := c.seekPages(to, definitionLevel) |
| 594 | if err != nil { |
| 595 | return nil, err |
| 596 | } |
| 597 | if done { |
| 598 | // This row group is exhausted try the next one. |
| 599 | continue |
| 600 | } |
| 601 | |
| 602 | c.seekWithinPage(to, definitionLevel) |
| 603 | break |
| 604 | } |
| 605 | |
| 606 | // The row group and page have been selected to where this value is possibly |
| 607 | // located. Now scan through the page and look for it. |
| 608 | for { |
| 609 | rn, v, err := c.next() |
| 610 | if err != nil { |
| 611 | return nil, err |
| 612 | } |
| 613 | if !rn.Valid() { |
| 614 | return nil, nil |
| 615 | } |
| 616 | |
| 617 | if CompareRowNumbers(definitionLevel, rn, to) >= 0 { |
| 618 | return c.makeResult(rn, v), nil |
| 619 | } |
| 620 | } |
| 621 | } |
| 622 | |
| 623 | func (c *SyncIterator) popRowGroup() (pq.RowGroup, RowNumber, RowNumber) { |
| 624 | if len(c.rgs) == 0 { |
nothing calls this directly
no test coverage detected