Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PECO-1752] Refactor CloudFetch downloader #234

Merged
merged 8 commits into from
Aug 23, 2024
164 changes: 0 additions & 164 deletions internal/fetcher/fetcher.go

This file was deleted.

123 changes: 0 additions & 123 deletions internal/fetcher/fetcher_test.go

This file was deleted.

23 changes: 2 additions & 21 deletions internal/rows/arrowbased/arrowRecordIterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,29 +163,10 @@ func (ri *arrowRecordIterator) getBatchIterator() error {

// Create a new batch iterator from a page of the result set
func (ri *arrowRecordIterator) newBatchIterator(fr *cli_service.TFetchResultsResp) (BatchIterator, error) {
bl, err := ri.newBatchLoader(fr)
if err != nil {
return nil, err
}

bi, err := NewBatchIterator(bl)

return bi, err
}

// Create a new batch loader from a page of the result set
func (ri *arrowRecordIterator) newBatchLoader(fr *cli_service.TFetchResultsResp) (BatchLoader, error) {
rowSet := fr.Results
var bl BatchLoader
var err error
if len(rowSet.ResultLinks) > 0 {
bl, err = NewCloudBatchLoader(ri.ctx, rowSet.ResultLinks, rowSet.StartRowOffset, &ri.cfg)
return NewCloudBatchIterator(ri.ctx, rowSet.ResultLinks, rowSet.StartRowOffset, &ri.cfg)
} else {
bl, err = NewLocalBatchLoader(ri.ctx, rowSet.ArrowBatches, rowSet.StartRowOffset, ri.arrowSchemaBytes, &ri.cfg)
return NewLocalBatchIterator(ri.ctx, rowSet.ArrowBatches, rowSet.StartRowOffset, ri.arrowSchemaBytes, &ri.cfg)
}
if err != nil {
return nil, err
}

return bl, nil
}
Loading
Loading