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



##########
File path: cpp/src/arrow/csv/writer.cc
##########
@@ -140,12 +142,15 @@ char* EscapeReverse(arrow::util::string_view s, char* 
out_end) {
 // from a cast does not require quoting or escaping.
 class UnquotedColumnPopulator : public ColumnPopulator {
  public:
-  explicit UnquotedColumnPopulator(MemoryPool* memory_pool, char end_char)
-      : ColumnPopulator(memory_pool, end_char) {}
+  explicit UnquotedColumnPopulator(MemoryPool* memory_pool, char end_char,
+                                   std::shared_ptr<Buffer> null_string_)
+      : ColumnPopulator(memory_pool, end_char, std::move(null_string_)) {}
 
   Status UpdateRowLengths(int32_t* row_lengths) override {
     for (int x = 0; x < casted_array_->length(); x++) {
-      row_lengths[x] += casted_array_->value_length(x);
+      row_lengths[x] += casted_array_->value_length(x) == 0

Review comment:
       Hmm. Should this instead check `casted_array_->IsNull(x)`? While I don't 
think any kernels would generate data like this, `value_length` may not be zero 
for a null 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]


Reply via email to