willbowditch commented on issue #12653:
URL: https://github.com/apache/arrow/issues/12653#issuecomment-1159030345
Finding the same thing in `pyarrow 8.0.0` converting from a CSV to Parquet -
I've tried various batch sizes on the scanner and various min/max rows/groups
on the writer.
Running in a container the memory usage increases to maximum and eventually
crashes.
```py
from pathlib import Path
import pyarrow.csv as csv
import pyarrow.dataset as ds
tsv_directory_path = Path("/dir/with/tsv")
read_schema = pa.schema([...])
input_tsv_dataset = ds.dataset(
tsv_directory_path,
read_schema,
format=ds.CsvFileFormat(
parse_options=csv.ParseOptions(delimiter="\t", quote_char=False)
),
)
scanner = input_tsv_dataset.scanner(batch_size=100)
ds.write_dataset(
scanner,
"output_directory.parquet",
format="parquet",
max_rows_per_file=10000,
max_rows_per_group=10000,
min_rows_per_group=10,
)
```
Using the `csv.open_csv` and `pq.ParquetWriter` to write batches to a single
file works fine, but results in a single large file.
--
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]