Skip to content

Commit

Permalink
use parquet.ByteArrayValue instead of ValueOf (#594)
Browse files Browse the repository at this point in the history
This should reduce allocations from any to []byte
  • Loading branch information
thorfour authored Nov 22, 2023
1 parent 066ad2b commit dcf20c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pqarrow/parquet.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func recordToRows(
if k != start {
rep = 1
}
scratchRows[i] = append(scratchRows[i], parquet.ValueOf(v).Level(rep, def+1, j))
scratchRows[i] = append(scratchRows[i], parquet.ByteArrayValue(v).Level(rep, def+1, j))
}
}
default:
Expand All @@ -134,7 +134,7 @@ func recordToRows(
vidx := arr.GetValueIndex(indexIntoRecord)
switch dict := arr.Dictionary().(type) {
case *array.Binary:
scratchRows[i] = append(scratchRows[i], parquet.ValueOf(dict.Value(vidx)).Level(0, def, j))
scratchRows[i] = append(scratchRows[i], parquet.ByteArrayValue(dict.Value(vidx)).Level(0, def, j))
default:
scratchRows[i] = append(scratchRows[i], parquet.ValueOf(dict.GetOneForMarshal(vidx)).Level(0, def, j))
}
Expand Down

0 comments on commit dcf20c4

Please sign in to comment.