Skip to content

Commit

Permalink
SNOW-1222159 Download arrow batches even if first one is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pfus committed Mar 7, 2024
1 parent 91692d4 commit 618468d
Showing 1 changed file with 17 additions and 18 deletions.
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

0 comments on commit 618468d

Please sign in to comment.