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 2023/01/20 10:14:40 UTC

[GitHub] [arrow] cyb70289 commented on a diff in pull request #33739: GH-33655: [C++][Parquet] Fix occasional failure in TestArrowReadWrite.MultithreadedWrite

cyb70289 commented on code in PR #33739:
URL: https://github.com/apache/arrow/pull/33739#discussion_r1082323239


##########
cpp/src/parquet/arrow/writer.cc:
##########
@@ -291,8 +291,13 @@ class FileWriterImpl : public FileWriter {
         arrow_properties_(std::move(arrow_properties)),
         closed_(false) {
     if (arrow_properties_->use_threads()) {
-      parallel_column_write_contexts_.resize(schema_->num_fields(),
-                                             {pool, arrow_properties_.get()});

Review Comment:
   Indeed, for `vector.resize()`, all vector elements are copy constructed from a single object [1], but `ArrowWriteContext` doesn't handle copying shared_ptr data members [2].
   
   I wonder if buffers in ArrowWriteContext supposed to be shared by multiple instances. If not, we can use unique_ptr.
   
   [1] https://godbolt.org/z/h7o3eW378
   [2] https://github.com/apache/arrow/blob/master/cpp/src/parquet/properties.h#L957



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