Shuai Zhang created ARROW-9510:
----------------------------------

             Summary: [C++] MapBuilder API is TOO MUCH CONFUSING
                 Key: ARROW-9510
                 URL: https://issues.apache.org/jira/browse/ARROW-9510
             Project: Apache Arrow
          Issue Type: Bug
    Affects Versions: 0.17.1
            Reporter: Shuai Zhang


MapBuilder API is too much confusing. Everybody know Map is consist of key & 
value pairs. However, the API value_builder is actually the pairs builder. 
Instead, the item_builder, whose name is usually means the pairs builder, is 
the value builder.

{code:c++}
  /// \brief Get builder to append items
  ///
  /// Appending an item with this builder should have been preceded
  /// by appending a key with key_builder().
  ArrayBuilder* item_builder() const { return item_builder_.get(); }

  /// \brief Get builder to add Map entries as struct values.
  ///
  /// This is used instead of key_builder()/item_builder() and allows
  /// the Map to be built as a list of struct values.
  ArrayBuilder* value_builder() const { return list_builder_->value_builder(); }
{code}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to