emkornfield commented on a change in pull request #11849:
URL: https://github.com/apache/arrow/pull/11849#discussion_r763307792



##########
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:
       ```
   int64_t CountStructuralChars2(const std::string& s) {
     int64_t result = 0;
     for (const auto c : s) {
         result += c == '"';
         result += c =='\n';
         result += c == '\r';
         result += c == ',';
     }
     return result;
   }
   ```
   Allows for auto-vectorization.




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