Skip to content
Open
Show file tree
Hide file tree
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
25 changes: 25 additions & 0 deletions arrow_batch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//go:build !nobatch
// +build !nobatch

package gosnowflake

import (
"github.com/apache/arrow-go/v18/arrow"
)

func (arc *arrowResultChunk) decodeArrowBatch(scd *snowflakeChunkDownloader) (*[]arrow.Record, error) {
var records []arrow.Record
defer arc.reader.Release()

for arc.reader.Next() {
rawRecord := arc.reader.Record()

record, err := arrowToRecord(scd.ctx, rawRecord, arc.allocator, scd.RowSet.RowType, arc.loc)
if err != nil {
return nil, err
}
records = append(records, record)
}

return &records, arc.reader.Err()
}
18 changes: 0 additions & 18 deletions arrow_chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/base64"
"time"

"github.com/apache/arrow-go/v18/arrow"
"github.com/apache/arrow-go/v18/arrow/ipc"
"github.com/apache/arrow-go/v18/arrow/memory"
)
Expand Down Expand Up @@ -51,23 +50,6 @@ func (arc *arrowResultChunk) decodeArrowChunk(ctx context.Context, rowType []exe
return chunkRows, arc.reader.Err()
}

func (arc *arrowResultChunk) decodeArrowBatch(scd *snowflakeChunkDownloader) (*[]arrow.Record, error) {
var records []arrow.Record
defer arc.reader.Release()

for arc.reader.Next() {
rawRecord := arc.reader.Record()

record, err := arrowToRecord(scd.ctx, rawRecord, arc.allocator, scd.RowSet.RowType, arc.loc)
if err != nil {
return nil, err
}
records = append(records, record)
}

return &records, arc.reader.Err()
}

// Build arrow chunk based on RowSet of base64
func buildFirstArrowChunk(rowsetBase64 string, loc *time.Location, alloc memory.Allocator) (arrowResultChunk, error) {
rowSetBytes, err := base64.StdEncoding.DecodeString(rowsetBase64)
Expand Down
Loading