NewScanQueryGenerator creates a new ScanQueryGenerator
(tbl *cache.PhysicalTable, expire time.Time, rangeStart, rangeEnd []types.Datum)
| 317 | |
| 318 | // NewScanQueryGenerator creates a new ScanQueryGenerator |
| 319 | func NewScanQueryGenerator(tbl *cache.PhysicalTable, expire time.Time, |
| 320 | rangeStart, rangeEnd []types.Datum) (*ScanQueryGenerator, error) { |
| 321 | if err := tbl.ValidateKeyPrefix(rangeStart); err != nil { |
| 322 | return nil, err |
| 323 | } |
| 324 | |
| 325 | if err := tbl.ValidateKeyPrefix(rangeEnd); err != nil { |
| 326 | return nil, err |
| 327 | } |
| 328 | |
| 329 | return &ScanQueryGenerator{ |
| 330 | tbl: tbl, |
| 331 | expire: expire, |
| 332 | keyRangeStart: rangeStart, |
| 333 | keyRangeEnd: rangeEnd, |
| 334 | firstBuild: true, |
| 335 | }, nil |
| 336 | } |
| 337 | |
| 338 | // NextSQL creates next sql of the scan task |
| 339 | func (g *ScanQueryGenerator) NextSQL(continueFromResult [][]types.Datum, nextLimit int) (string, error) { |
searching dependent graphs…