iajoiner commented on a change in pull request #9702:
URL: https://github.com/apache/arrow/pull/9702#discussion_r787134626
##########
File path: python/pyarrow/tests/test_orc.py
##########
@@ -190,6 +195,271 @@ def test_orcfile_readwrite():
orc_file = orc.ORCFile(buffer_reader)
output_table = orc_file.read()
assert table.equals(output_table)
+ # Check for default WriteOptions
+ assert orc_file.compression == 'ZLIB'
+ assert orc_file.file_version == '0.12'
+ assert orc_file.row_index_stride == 10000
+ assert orc_file.compression_size == 65536
+
+
+def test_orcfile_readwrite_with_writeoptions():
+ from pyarrow import orc
+
+ buffer_output_stream = pa.BufferOutputStream()
+ a = pa.array([1, None, 3, None])
+ b = pa.array([None, "Arrow", None, "ORC"])
+ table = pa.table({"int64": a, "utf8": b})
+ orc.write_table(
+ table,
+ buffer_output_stream,
+ compression='snappy',
+ file_version='0.11',
+ row_index_stride=5000,
+ compression_block_size=32768,
+ )
+ buffer_reader = pa.BufferReader(buffer_output_stream.getvalue())
+ orc_file = orc.ORCFile(buffer_reader)
+ output_table = orc_file.read()
+ assert table.equals(output_table)
+ # Check for default WriteOptions
Review comment:
Ah...Thanks!
--
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]