Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion python/pyarrow/_parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ 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 +826,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
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