apache / apache/arrow

Parquet write_table killed when run from script

Open
#14,094 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

Hello, I'm trying to merge a large quantity of Parquet files into a single Parquet file which works fine from Python shell. The files to merge are stored in the 'chunks' directory and the merge produces a 3.7G file.
And yet I fail to merge the files when running the same command from a Python script:
```
>>> import pandas as pd
>>> import pyarrow.parquet as pq
>>> chunks_path = './chunks'
>>> pq.write_table(pq.ParquetDataset(chunks_path).read(), 'merge_test.parquet', row_group_size=100000)
ubuntu@ip-xxx$ ls *.parquet
merge_test.parquet
ubuntu@ip-xxx1$ du -sh merge_test.parquet
3.7G merge_test.parquet
In Python Script:
print('combine results')
pq.write_table(pq.ParquetDataset(chunks_path).read(), 'results.parquet', row_group_size=100000)
Terminal:
combine results
killed
```

What may be the reason for the failure to merge the files when run from a script and how can it be fixed?
I'm using Ubuntu on ec2 instance('c5.12xlarge'), 48 vCPU cores, 96Mb RAM

Contributor guide

Open the contributing guide

Research direction

Start with the reported Python entry points, pq.ParquetDataset(chunks_path).read() and pq.write_table(...), and reproduce the command in both the interactive shell and a script on Ubuntu. Inspect the process and available memory when the script is killed; done means identifying the difference, confirming the cause, and documenting or implementing a supported fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.