lidavidm commented on a change in pull request #12426:
URL: https://github.com/apache/arrow/pull/12426#discussion_r806807912



##########
File path: cpp/src/arrow/csv/writer.cc
##########
@@ -406,7 +405,7 @@ class CSVWriterImpl : public ipc::RecordBatchWriter {
     std::vector<std::unique_ptr<ColumnPopulator>> 
populators(schema->num_fields());
     for (int col = 0; col < schema->num_fields(); col++) {
       const std::string& end_chars =
-          col < schema->num_fields() - 1 ? kStrComma : options.eol;
+          col < schema->num_fields() - 1 ? std::string(1,options.delimiter) : 
options.eol;

Review comment:
       While the compiler will likely do this for us, we should probably hoist 
the string construction outside of the loop.

##########
File path: python/pyarrow/_csv.pyx
##########
@@ -1025,17 +1025,21 @@ cdef class WriteOptions(_Weakrefable):
     batch_size : int, optional (default 1024)
         How many rows to process together when converting and writing
         CSV data
+    delimiter : char, optional (default `'`)

Review comment:
       See 
https://github.com/apache/arrow/blob/36a76914cd42606be7ef847d500af67c64ccef26/python/pyarrow/_csv.pyx#L278
 for instance

##########
File path: python/pyarrow/_csv.pyx
##########
@@ -1025,17 +1025,21 @@ cdef class WriteOptions(_Weakrefable):
     batch_size : int, optional (default 1024)
         How many rows to process together when converting and writing
         CSV data
+    delimiter : char, optional (default `'`)

Review comment:
       nit, but I think Python would use `"'"`, and char is not a type in 
Python (it should be str). And in any case, is the delimiter not `,`?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to