Skip to content

Commit

Permalink
fix: turn on compression on stream writers (#34067)
Browse files Browse the repository at this point in the history
See #31679

Signed-off-by: Ted Xu <[email protected]>
  • Loading branch information
tedxu authored Jun 24, 2024
1 parent 03a3f50 commit 78885a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/storage/serde.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/apache/arrow/go/v12/arrow"
"github.com/apache/arrow/go/v12/arrow/array"
"github.com/apache/arrow/go/v12/parquet"
"github.com/apache/arrow/go/v12/parquet/compress"
"github.com/apache/arrow/go/v12/parquet/pqarrow"
"github.com/golang/protobuf/proto"

Expand Down Expand Up @@ -663,7 +664,10 @@ func (sfw *singleFieldRecordWriter) Close() {
func newSingleFieldRecordWriter(fieldId FieldID, field arrow.Field, writer io.Writer) (*singleFieldRecordWriter, error) {
schema := arrow.NewSchema([]arrow.Field{field}, nil)
fw, err := pqarrow.NewFileWriter(schema, writer,
parquet.NewWriterProperties(parquet.WithMaxRowGroupLength(math.MaxInt64)), // No additional grouping for now.
parquet.NewWriterProperties(
parquet.WithMaxRowGroupLength(math.MaxInt64), // No additional grouping for now.
parquet.WithCompression(compress.Codecs.Zstd),
parquet.WithCompressionLevel(3)),
pqarrow.DefaultWriterProps())
if err != nil {
return nil, err
Expand Down

0 comments on commit 78885a4

Please sign in to comment.