iajoiner commented on a change in pull request #9702:
URL: https://github.com/apache/arrow/pull/9702#discussion_r759850713
##########
File path: python/pyarrow/_orc.pyx
##########
@@ -38,6 +38,283 @@ from pyarrow.lib cimport (check_status, _Weakrefable,
get_writer)
from pyarrow.lib import tobytes
+cdef compression_kind_from_enum(CompressionKind compression_kind_):
+ return {
+ _CompressionKind_NONE: 'NONE',
+ _CompressionKind_ZLIB: 'ZLIB',
+ _CompressionKind_SNAPPY: 'SNAPPY',
+ _CompressionKind_LZO: 'LZO',
+ _CompressionKind_LZ4: 'LZ4',
+ _CompressionKind_ZSTD: 'ZSTD',
+ }.get(compression_kind_, 'UNKNOWN')
+
+cdef CompressionKind compression_kind_from_name(name):
+ name = name.upper()
+ if name == 'ZLIB':
+ return _CompressionKind_ZLIB
+ elif name == 'SNAPPY':
+ return _CompressionKind_SNAPPY
+ elif name == 'LZO':
+ return _CompressionKind_LZO
+ elif name == 'LZ4':
+ return _CompressionKind_LZ4
+ elif name == 'ZSTD':
+ return _CompressionKind_ZSTD
+ else:
+ return _CompressionKind_NONE
Review comment:
Fixed! Note that the None case is obviously 'uncompressed'.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]