You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "wjones127 (via GitHub)" <gi...@apache.org> on 2023/03/13 16:17:42 UTC
[GitHub] [arrow] wjones127 commented on issue #34546: Datasets with partitions create a list instead of folders
wjones127 commented on issue #34546:
URL: https://github.com/apache/arrow/issues/34546#issuecomment-1466458699
Hi John, have you looked at the values in your `table`? Do any of them contain the value `[\n"partition1"\n]`?
I tried to reproduce this (just locally, not GCS yet), but was not able to (writing the dataset worked fine):
```python
import pyarrow as pa
import pyarrow.dataset as ds
table = pa.table(
{
"partition1": ["1", "2", "3", "4", "5"],
"partition2": ["2001", "2002", "2003", "2004", "2004"],
"3": ["1", "2", "3", "4", "5"],
"val": list(range(5)),
}
)
file_options = ds.ParquetFileFormat().make_write_options(compression="zstd")
partitions = ds.partitioning(
schema=pa.schema(
[
("partition1", pa.large_string()),
("partition2", pa.large_string()),
("3", pa.large_string()),
]
)
)
ds.write_dataset(
table,
f"tables/test_parts",
format="parquet",
file_options=file_options,
partitioning=partitions,
schema=table.schema,
existing_data_behavior="overwrite_or_ignore",
)
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org