Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support specifying quote and escape in Csv WriterBuilder #5146

Closed
alamb opened this issue Nov 29, 2023 · 2 comments · Fixed by #5196
Closed

Support specifying quote and escape in Csv WriterBuilder #5146

alamb opened this issue Nov 29, 2023 · 2 comments · Fixed by #5196
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers

Comments

@alamb
Copy link
Contributor

alamb commented Nov 29, 2023

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In DataFusion apache/datafusion#8351 we are adding support to specify the escaping and quote characters used for CSV reading.

It turns out that the Arrow CSV writer does not support specifying the escape and quoting characters

Describe the solution you'd like
I would like the following in the CSV WriterBuilder:

Describe alternatives you've considered

Additional context

@alamb alamb added arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog labels Nov 29, 2023
@tustvold tustvold added the good first issue Good for newcomers label Nov 29, 2023
@tustvold
Copy link
Contributor

tustvold commented Nov 29, 2023

This should be a relatively straightforward first issue.

I would highlight though that "escape" is advised against by the CSV library we use, and we should probably highlight this in any documentation - https://docs.rs/csv/latest/csv/struct.WriterBuilder.html#method.escape

In some variants of CSV, quotes are escaped using a special escape character like \ (instead of escaping quotes by doubling them).
By default, writing these idiosyncratic escapes is disabled, and is only used when double_quote is disabled.

@my-vegetable-has-exploded
Copy link
Contributor

I'd like to have a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants