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

SNOW-1222159 Download arrow batches even if first one is empty #1068

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions chunk_downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,32 +271,31 @@ func getChunk(
}

func (scd *snowflakeChunkDownloader) startArrowBatches() error {
if scd.RowSet.RowSetBase64 == "" {
return nil
}
var err error
chunkMetaLen := len(scd.ChunkMetas)
var loc *time.Location
if scd.sc != nil && scd.sc.cfg != nil {
loc = getCurrentLocation(scd.sc.cfg.Params)
}
firstArrowChunk, err := buildFirstArrowChunk(scd.RowSet.RowSetBase64, loc, scd.pool)
if err != nil {
return err
}
scd.FirstBatch = &ArrowBatch{
idx: 0,
scd: scd,
funcDownloadHelper: scd.FuncDownloadHelper,
loc: loc,
}
// decode first chunk if possible
if firstArrowChunk.allocator != nil {
scd.FirstBatch.rec, err = firstArrowChunk.decodeArrowBatch(scd)
if scd.RowSet.RowSetBase64 != "" {
var err error
firstArrowChunk, err := buildFirstArrowChunk(scd.RowSet.RowSetBase64, loc, scd.pool)
if err != nil {
return err
}
scd.FirstBatch = &ArrowBatch{
idx: 0,
scd: scd,
funcDownloadHelper: scd.FuncDownloadHelper,
loc: loc,
}
// decode first chunk if possible
if firstArrowChunk.allocator != nil {
scd.FirstBatch.rec, err = firstArrowChunk.decodeArrowBatch(scd)
if err != nil {
return err
}
}
}
chunkMetaLen := len(scd.ChunkMetas)
scd.ArrowBatches = make([]*ArrowBatch, chunkMetaLen)
for i := range scd.ArrowBatches {
scd.ArrowBatches[i] = &ArrowBatch{
Expand Down
Loading