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 2021/12/06 14:33:56 UTC

[GitHub] [arrow] ahadnagy commented on a change in pull request #11863: ARROW-14906: [C++] Enable CSV Writer to control the type of escape used for quoting

ahadnagy commented on a change in pull request #11863:
URL: https://github.com/apache/arrow/pull/11863#discussion_r763060850



##########
File path: cpp/src/arrow/csv/writer.cc
##########
@@ -126,13 +126,14 @@ class ColumnPopulator {
 
 // Copies the contents of to out properly escaping any necessary characters.
 // Returns the position prior to last copied character (out_end is decremented).
-char* EscapeReverse(arrow::util::string_view s, char* out_end) {
+char* EscapeReverse(arrow::util::string_view s, char* out_end, bool escaping,
+                    char escape_char) {
   for (const char* val = s.data() + s.length() - 1; val >= s.data(); val--, out_end--) {
-    if (*val == '"') {
-      *out_end = *val;
+    *out_end = *val;
+    if (escaping && *val == '"') {

Review comment:
       https://www.rdocumentation.org/packages/readr/versions/1.3.1/topics/write_delim
   If I understand correctly, the R function we're trying to align with only escapes quotes.
   
   (Correspond line in the Vroom source: https://github.com/r-lib/vroom/blob/c5b115b1b5f21852886d6407317386b215706239/src/vroom_write.cc#L146)
   




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