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 2022/02/24 02:40:16 UTC

[GitHub] [arrow] cyb70289 commented on a change in pull request #12504: ARROW-15763: [C++] Improve CSV writer

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



##########
File path: cpp/src/arrow/csv/writer.cc
##########
@@ -170,11 +178,17 @@ class UnquotedColumnPopulator : public ColumnPopulator {
       RETURN_NOT_OK(CheckStringArrayHasNoStructuralChars(*casted_array_, delimiter_));
     }
 
-    for (int x = 0; x < casted_array_->length(); x++) {
-      row_lengths[x] += casted_array_->IsNull(x)
-                            ? static_cast<int32_t>(null_string_->size())
-                            : casted_array_->value_length(x);
-    }

Review comment:
       `VisistArrayDataInline` processes continuous non-null / null blocks in batch and performs better than this bit by bit checking, though looks doing more work (extracts the string_view but only string length is needed).




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