You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/25 09:09:33 UTC

[GitHub] [arrow] phpsxg commented on issue #14725: How to partition by quantity with write_to_dataset

phpsxg commented on issue #14725:
URL: https://github.com/apache/arrow/issues/14725#issuecomment-1327188431

   > Without knowing what your data looks like it is hard to say how to better partition it. But you can raise the maximum number of partitions via `max_partitions` which defaults to 1024 or you could just limit the number of rows per file if you don't have a more specific partitioning scheme with `max_rows_per_file`: https://arrow.apache.org/docs/python/generated/pyarrow.dataset.write_dataset.html#pyarrow.dataset.write_dataset
   > 
   > Feel free to close the issue if this answers your question.
   
   
   Thank you, ds.write_dataset meets my needs, but I have two more questions
   
   1. Is there any difference between **pq.write_to_dataset** and **ds.write_dataset**?
   2. How to implement dynamic filtering with ds.write_dataset, if the filters I get according to different parameters are a list
   
   For example, there are two filters, which is fine
   `df = dataset.to_table(filter=( ds.field('c').is_null()) & (ds.field('b') > 0)).to_pandas()`
   
   But if the filter is a list, how to pass the parameters
   ```
   filters = []
   if ...:
       filters.append(ds.field('c').is_null())
   if ....:
       filters.append(ds.field('b') > 0)
   ```


-- 
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