wjones127 commented on issue #34546:
URL: https://github.com/apache/arrow/issues/34546#issuecomment-1466587443

   I think even if the arrays are `large_string`, you can still specify 
`string` in the partitioning. This seems to work:
   
   ```python
   import pyarrow as pa
   import pyarrow.dataset as ds
   
   table = pa.table(
       {
           "partition1": pa.array(["1", "2", "3", "4", "5"], pa.large_string()),
           "partition2": pa.array(["2001", "2002", "2003", "2004", "2004"], 
pa.large_string()),
           "3": pa.array(["1", "2", "3", "4", "5"], pa.large_string()),
           "val": list(range(5)),
       }
   )
   
   file_options = ds.ParquetFileFormat().make_write_options(compression="zstd")
   partitions = ds.partitioning(
       schema=pa.schema(
           [
               ("partition1", pa.string()),
               ("partition2", pa.string()),
               ("3", pa.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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to