Repository navigation
GH-36247: [R] Add write_csv_dataset - #36436
Conversation
|
|
thisisnic
left a comment
There was a problem hiding this comment.
Thanks for making this PR!
This is looking good so far, and have added some comments about potential changes.
One thought I had is that when I was designing open_csv_dataset() etc, the parameters in that function are different to those in open_dataset() as they are intended to reflect those in read_csv_arrow(). read_csv_arrow() in turn mirrors the parameters in readr::read_csv(). The idea behind this is that you can use the same code as you would if you were using readr for the workflows.
The implementation of write_csv_arrow() doesn't do this (maybe it should, but that hasn't been done yet), but we could do those things here.
In the implementation of open_csv_dataset(), I also intentionally don't allow extra things to be passed in via the ..., to try to keep things simpler to reason about (advanced users can use open_dataset() and pass in whatever they like there, if they need to).
What I'm wondering is, if we want to take the opportunity to expose the options differently here, to create an API for users that is easier to reason about.
For example, readr::write_csv has the following options exposed in its parameters:
naappendcol_namesquoteescapeeol
We could take these, work out if they map to the Arrow options nicely, and do the hard work inside of the function to convert them for the user, a bit like we do for the CSV reader.
What do you think? I appreciate that this sounds like a whole lot of work, so I'd be happy to break it down into smaller tasks and do some bits myself if you didn't want to do the whole lot.
Got it, I created a separate issue #36700 to add the other functions
Makes sense, I'll update it to follow that convention.
Right now The mapping of |
|
@thisisnic I think it's ready for another review. |
thisisnic
left a comment
There was a problem hiding this comment.
Thanks - had a look at this with the conversation from the last package dev meeting in mind, and added a few comments below. Lots of this is looking done and I think we'll just need to iron out details.
Co-authored-by: Nic Crane <thisisnic@gmail.com>
Co-authored-by: Nic Crane <thisisnic@gmail.com>
|
Thanks I've accepted the changes and it should be good to go. |
thisisnic
left a comment
There was a problem hiding this comment.
Thanks, looks good to merge now!
|
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 8f347c5. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them. |
### Rationale for this change Create a convenience wrapper around `write_dataset` for csv files. ### What changes are included in this PR? Adds a `write_csv_dataset()` ### Are these changes tested? Yes a few tests were added. ### Are there any user-facing changes? Yes a new function has been added. If this looks good I can add more to the docs as well. * Closes: apache#36247 Lead-authored-by: David Greiss <david.dgreiss@gmail.com> Co-authored-by: Nic Crane <thisisnic@gmail.com> Co-authored-by: David Greiss <dgreiss@users.noreply.github.com> Signed-off-by: Nic Crane <thisisnic@gmail.com>
Rationale for this change
Create a convenience wrapper around
write_datasetfor csv files.What changes are included in this PR?
Adds a
write_csv_dataset()Are these changes tested?
Yes a few tests were added.
Are there any user-facing changes?
Yes a new function has been added. If this looks good I can add more to the docs as well.
write_csv_dataset()#36247