[Python] ParquetDataset deadlock with different metadata_nthreads values
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
```Java
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
output_folder = "C:\scr\tmp"
weather_df = pd.DataFrame({"a": [1, 1, 1, 2, 2, 2, 3, 3, 3], "b": [1, 1, 1, 1, 5, 1, 1, 1, 1], "c": ["c1", "c1", "c1", "c10", "c20", "c30", "c1", "c1", "c1"], "d": [32, 32, 32, 32, 32, 32, 32, 32, 32] })
table = pa.Table.from_pandas(weather_df)
pq.write_to_dataset(table, root_path=output_folder, partition_cols=["a", "b", "c"])
```
# works for 1 thread
```Java
dataset = pq.ParquetDataset(output_folder, metadata_nthreads=1, validate_schema=False)
```
# stuck for 2~6 threads (but it may vary from time to time)
```Java
dataset = pq.ParquetDataset(output_folder, metadata_nthreads=2, validate_schema=False)
dataset = pq.ParquetDataset(output_folder, metadata_nthreads=6, validate_schema=False)
```
# works for 60 thread
```Java
dataset = pq.ParquetDataset(output_folder, metadata_nthreads=60, validate_schema=False)
```
**Reporter**: [Chongkai Zhu](https://issues.apache.org/jira/browse/ARROW-7385)
**Note**: *This issue was originally created as [ARROW-7385](https://issues.apache.org/jira/browse/ARROW-7385). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Contributor guide
Assessment
This issue has not been assessed yet.