Skip to content

Commit

Permalink
fix race condition in lz4_raw compression
Browse files Browse the repository at this point in the history
  • Loading branch information
hangxie committed Aug 17, 2024
1 parent 9ddb178 commit f9fb536
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compress/lz4_raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
)

func init() {
lz4hc := lz4.CompressorHC{
Level: lz4.CompressionLevel(9),
}
compressors[parquet.CompressionCodec_LZ4_RAW] = &Compressor{
Compress: func(buf []byte) []byte {
lz4hc := lz4.CompressorHC{
Level: lz4.CompressionLevel(9),
}
res := make([]byte, lz4.CompressBlockBound(len(buf)))
count, _ := lz4hc.CompressBlock(buf, res)
return res[:count]
Expand Down

0 comments on commit f9fb536

Please sign in to comment.