pitrou commented on code in PR #40271:
URL: https://github.com/apache/arrow/pull/40271#discussion_r1509250590


##########
cpp/src/arrow/csv/writer.cc:
##########
@@ -128,10 +139,14 @@ class ColumnPopulator {
     // Populators are intented to be applied to reasonably small data.  In 
most cases
     // threading overhead would not be justified.
     ctx.set_use_threads(false);
-    ASSIGN_OR_RAISE(
-        std::shared_ptr<Array> casted,
-        compute::Cast(data, /*to_type=*/utf8(), compute::CastOptions(), &ctx));
-    casted_array_ = checked_pointer_cast<StringArray>(casted);
+    auto casted = compute::Cast(data, /*to_type=*/utf8(), 
compute::CastOptions(), &ctx);

Review Comment:
   Perhaps not very important, but I think the algorithm should ideally be:
   1. if the input data is large_binary or large_utf8, cast it to large_utf8
   2. otherwise, try to cast it to utf8, and fallback to large_utf8



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