pitrou commented on a change in pull request #11855:
URL: https://github.com/apache/arrow/pull/11855#discussion_r765050118



##########
File path: cpp/src/arrow/array/builder_nested.h
##########
@@ -329,9 +329,7 @@ class ARROW_EXPORT MapBuilder : public ArrayBuilder {
   /// the Map to be built as a list of struct values.
   ArrayBuilder* value_builder() const { return list_builder_->value_builder(); 
}
 
-  std::shared_ptr<DataType> type() const override {
-    return map(key_builder_->type(), item_builder_->type(), keys_sorted_);
-  }
+  std::shared_ptr<DataType> type() const override { return type_; }

Review comment:
       Hmm... unfortunately, I don't think this is right. Some child builders 
can actually change type over time (for example the index width of a dictionary 
may increase depending on the dictionary size). So we have to keep the dynamic 
computation in the `type()` method.
   




-- 
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-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to