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



##########
File path: cpp/src/arrow/csv/options.cc
##########
@@ -73,6 +73,9 @@ Status ReadOptions::Validate() const {
 WriteOptions WriteOptions::Defaults() { return WriteOptions(); }
 
 Status WriteOptions::Validate() const {
+  if (ARROW_PREDICT_FALSE(delimiter == '\n' || delimiter == '\r' || delimiter 
== '"')) {
+    return Status::Invalid("WriteOptions: delimiter cannot be \\r or \\n");

Review comment:
       We support customized eol strings excepts `\n, \r, \r\n`, such as 
`_EOL_` as line separator in csv writer [1].
   Is it useful in practice? Our csv parser doesn't suppot it, AFAIK, @pitrou 
   
   Pandas.read_csv can specify a **single char** eol breaker by 
`lineterminator` parameter [2], works as expected per my test. But looks our 
eol string is too much?
   
   [1] 
https://github.com/apache/arrow/blob/master/cpp/src/arrow/csv/writer_test.cc#L116
   [2] https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html




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