ZhangHuiGui opened a new issue, #41193:
URL: https://github.com/apache/arrow/issues/41193

   ### Describe the enhancement requested
   
   Case like below:
   ```c
   Status RowArray::InitIfNeeded(MemoryPool* pool, const ExecBatch& batch) {
     if (is_initialized_) {
       return Status::OK();
     }
     std::vector<KeyColumnMetadata> column_metadatas;
     RETURN_NOT_OK(ColumnMetadatasFromExecBatch(batch, &column_metadatas));
     RowTableMetadata row_metadata;
     row_metadata.FromColumnMetadataVector(column_metadatas, sizeof(uint64_t),
                                           sizeof(uint64_t));
   
     return InitIfNeeded(pool, row_metadata);
   }
   ```
   
   The `FromColumnMetadataVector` will be called again in `encoder_.Init` 
called by `InitIfNeeded(pool, row_metadata);`. 
   It's not good for performance, because the logic `FromColumnMetadataVector` 
will traverse the input column several times
   for column-sort and fill some variables  again after we call 
`FromColumnMetadataVector` first.
   
   ### Component(s)
   
   C++


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