Skip to content

Commit

Permalink
SNOW-911238: after CR 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dstempniak committed Oct 5, 2023
1 parent 0845d66 commit 96dbab6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arrow_chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (arc *arrowResultChunk) decodeArrowBatch(scd *snowflakeChunkDownloader) (*[
for arc.reader.Next() {
rawRecord := arc.reader.Record()

record, err := arrowToRecord(rawRecord, arc.allocator, scd.RowSet.RowType, arc.loc, scd.ctx)
record, err := arrowToRecord(scd.ctx, rawRecord, arc.allocator, scd.RowSet.RowType, arc.loc)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ func originalTimestampEnabled(ctx context.Context) bool {
return ok && d
}

func arrowToRecord(record arrow.Record, pool memory.Allocator, rowType []execResponseRowType, loc *time.Location, ctx context.Context) (arrow.Record, error) {
func arrowToRecord(ctx context.Context, record arrow.Record, pool memory.Allocator, rowType []execResponseRowType, loc *time.Location) (arrow.Record, error) {
useOriginalTimestamp := originalTimestampEnabled(ctx)

s, err := recordToSchema(record.Schema(), rowType, loc, useOriginalTimestamp)
Expand All @@ -990,7 +990,7 @@ func arrowToRecord(record arrow.Record, pool memory.Allocator, rowType []execRes

var cols []arrow.Array
numRows := record.NumRows()
ctxAlloc := compute.WithAllocator(context.Background(), pool)
ctxAlloc := compute.WithAllocator(ctx, pool)

for i, col := range record.Columns() {
srcColumnMeta := rowType[i]
Expand Down
2 changes: 1 addition & 1 deletion converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ func TestArrowToRecord(t *testing.T) {
ctx = WithOriginalTimestamp(ctx)
}

transformedRec, err := arrowToRecord(rawRec, pool, []execResponseRowType{meta}, localTime.Location(), ctx)
transformedRec, err := arrowToRecord(ctx, rawRec, pool, []execResponseRowType{meta}, localTime.Location())
if err != nil {
if tc.error == "" || !strings.Contains(err.Error(), tc.error) {
t.Fatalf("error: %s", err)
Expand Down

0 comments on commit 96dbab6

Please sign in to comment.