johanpel commented on a change in pull request #11849:
URL: https://github.com/apache/arrow/pull/11849#discussion_r763865614
##########
File path: cpp/src/arrow/csv/writer.cc
##########
@@ -72,11 +72,29 @@ RecordBatchIterator RecordBatchSliceIterator(const
RecordBatch& batch,
return RecordBatchIterator(std::move(functor));
}
-// Counts the number of characters that need escaping in s.
-int64_t CountEscapes(util::string_view s) {
+// Counts the number of quotes in s.
+int64_t CountQuotes(util::string_view s) {
return static_cast<int64_t>(std::count(s.begin(), s.end(), '"'));
}
+// Counts the number of CSV structural characters in s.
+int64_t CountStructuralChars(util::string_view s) {
Review comment:
Thinking about this a bit more we don't actually have to count. I moved
this into `CheckStringHasNoStructuralChars` and use std::any_of there to detect
if there are any structural chars in the value string.
--
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]