edponce commented on a change in pull request #12055:
URL: https://github.com/apache/arrow/pull/12055#discussion_r825252946
##########
File path: cpp/src/arrow/chunked_array.cc
##########
@@ -43,15 +43,17 @@ class MemoryPool;
// ChunkedArray methods
ChunkedArray::ChunkedArray(ArrayVector chunks, std::shared_ptr<DataType> type)
- : chunks_(std::move(chunks)), type_(std::move(type)) {
- length_ = 0;
- null_count_ = 0;
-
+ : chunks_(std::move(chunks)),
+ type_(std::move(type)),
+ resolver_{internal::ChunkResolver::FromChunks(chunks_)} {
Review comment:
Constructing the `ChunkResolver` adds overhead to all `ChunkedArray`
instances, and the `resolver_` is only used for `GetScalar()`. Maybe a better
approach is to have a flag or pointer to control single `resolver_`
initialization when calling `GetScalar`.
cc @pitrou
--
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]