Skip to content
Closed
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
22 changes: 20 additions & 2 deletions python/pyarrow/tests/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2445,13 +2445,31 @@ def test_large_table_int32_overflow():
_write_table(table, f)


def _simple_table_roundtrip(table):
def _simple_table_roundtrip(table, **write_kwargs):
stream = pa.BufferOutputStream()
_write_table(table, stream)
_write_table(table, stream, **write_kwargs)
buf = stream.getvalue()
return _read_table(buf)


@pytest.mark.large_memory
def test_byte_array_exactly_2gb():
# Test edge case reported in ARROW-3762
val = b'x' * (1 << 10)

base = pa.array([val] * ((1 << 21) - 1))
cases = [
[b'x' * 1023], # 2^31 - 1
[b'x' * 1024], # 2^31
[b'x' * 1025] # 2^31 + 1
]
for case in cases:
values = pa.chunked_array([base, pa.array(case)])
t = pa.table([values], names=['f0'])
result = _simple_table_roundtrip(t, use_dictionary=False)
assert t.equals(result)


@pytest.mark.pandas
@pytest.mark.large_memory
def test_binary_array_overflow_to_chunked():
Expand Down