[ 
https://issues.apache.org/jira/browse/ARROW-14010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17415977#comment-17415977
 ] 

Joris Van den Bossche commented on ARROW-14010:
-----------------------------------------------

We discussed this in ARROW-10695, and eventually decided that this could be 
relatively easily be done by the user by generating the uuid when passing the 
template ({{basename_template=guuid() + "-\{i\}.parquet"}})

I think for a case where you are appending data, you will typically be able to 
pass a unique basename_template? 
One consequence of this, though, is that all files written from a single 
{{write_dataset}} call will have the same uuid, instead of each file having 
it's own uuid (although I think that's consistent with what spark does).

Personally, I was fine with the resolution of ARROW-10695 (leave it up to the 
user, instead of providing a {{\{uuid\}}} substitution option), unless someone 
comes up with a use case where it is impossible to provide this uuid in the 
template. But, I am also thinking whether we shouldn't actually include a UUID 
in the default template. 

Slightly related, I also ran into the issue of "basename_template requires 
\{i\}" in a case where I wanted to manually create unique file names with the 
template (and I knew I had only one file per partition), and had been meaning 
to open a JIRA about that. It seems a limitation we could relax. 


> [C++][Python] No way to generate UUID filenames with new datasets API
> ---------------------------------------------------------------------
>
>                 Key: ARROW-14010
>                 URL: https://issues.apache.org/jira/browse/ARROW-14010
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Weston Pace
>            Assignee: Weston Pace
>            Priority: Major
>
> I had assumed this could be done using the "partition_filename_cb" in 
> "pyarrow.parquet.write_to_dataset" but that doesn't work if 
> "use_legacy_dataset" is False.  The "basename_template" only allows string 
> substitution so it cannot inject UUID.  Given that this is the only support 
> for any kind of "append" mode when writing to datasets I think this feature 
> is important and can block migration from the old writer.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to