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 2021/09/21 13:22:27 UTC
[GitHub] [arrow] amol- commented on a change in pull request #11197: ARROW-14054: [C++] [Docs] Simplify C++ row conversion example
amol- commented on a change in pull request #11197:
URL: https://github.com/apache/arrow/pull/11197#discussion_r713034657
##########
File path: cpp/examples/arrow/row_wise_conversion_example.cc
##########
@@ -61,51 +65,52 @@ arrow::Status VectorToColumnarTable(const std::vector<struct data_row>& rows,
arrow::MemoryPool* pool = arrow::default_memory_pool();
Int64Builder id_builder(pool);
- DoubleBuilder cost_builder(pool);
- ListBuilder components_builder(pool, std::make_shared<DoubleBuilder>(pool));
- // The following builder is owned by components_builder.
- DoubleBuilder& cost_components_builder =
- *(static_cast<DoubleBuilder*>(components_builder.value_builder()));
+ Int64Builder components_builder(pool);
+ ListBuilder component_cost_builder(pool, std::make_shared<DoubleBuilder>(pool));
+ // The following builder is owned by component_cost_builder.
+ DoubleBuilder& component_item_cost_builder =
+ *(static_cast<DoubleBuilder*>(component_cost_builder.value_builder()));
Review comment:
I think it would be easier to follow if we made `component_item_cost_builder` a pointer instead of a reference.
That would make much more obvious that `component_item_cost_builder` is the `value_builder` of `component_cost_builder` and we are not creating anything new.
--
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