Skip to content
Closed
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
1 change: 1 addition & 0 deletions python/pyarrow/_parquet.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ cdef extern from "parquet/api/schema.h" namespace "parquet" nogil:
ParquetCompression_LZO" parquet::Compression::LZO"
ParquetCompression_BROTLI" parquet::Compression::BROTLI"
ParquetCompression_LZ4" parquet::Compression::LZ4"
ParquetCompression_ZSTD" parquet::Compression::ZSTD"

enum ParquetVersion" parquet::ParquetVersion::type":
ParquetVersion_V1" parquet::ParquetVersion::PARQUET_1_0"
Expand Down
5 changes: 4 additions & 1 deletion python/pyarrow/_parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,8 @@ cdef class ParquetReader:
return array

cdef int check_compression_name(name) except -1:
if name.upper() not in ['NONE', 'SNAPPY', 'GZIP', 'LZO', 'BROTLI', 'LZ4']:
if name.upper() not in ['NONE', 'SNAPPY', 'GZIP', 'LZO', 'BROTLI', 'LZ4',
'ZSTD']:
raise ArrowException("Unsupported compression: " + name)
return 0

Expand All @@ -826,6 +827,8 @@ cdef ParquetCompression compression_from_name(str name):
return ParquetCompression_BROTLI
elif name == "LZ4":
return ParquetCompression_LZ4
elif name == "ZSTD":
return ParquetCompression_ZSTD
else:
return ParquetCompression_UNCOMPRESSED

Expand Down
1 change: 1 addition & 0 deletions python/pyarrow/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def _sanitize_table(table, new_schema, flavor):
Valid values: {None, 'ms', 'us'}
compression : str or dict
Specify the compression codec, either on a general basis or per-column.
Valid values: {'NONE', 'SNAPPY', 'GZIP', 'LZO', 'BROTLI', 'LZ4', 'ZSTD'}
flavor : {'spark'}, default None
Sanitize schema or set other compatibility options for compatibility"""

Expand Down
2 changes: 1 addition & 1 deletion python/pyarrow/tests/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def test_pandas_parquet_configuration_options(tmpdir):
df_read = table_read.to_pandas()
tm.assert_frame_equal(df, df_read)

for compression in ['NONE', 'SNAPPY', 'GZIP', 'LZ4']:
for compression in ['NONE', 'SNAPPY', 'GZIP', 'LZ4', 'ZSTD']:
_write_table(arrow_table, filename.strpath,
version="2.0",
compression=compression)
Expand Down