[ 
https://issues.apache.org/jira/browse/ARROW-7985?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Antoine Pitrou reassigned ARROW-7985:
-------------------------------------

    Assignee: Antoine Pitrou

> [C++] ListBuilder.Finish fails if underlying value builder is empty and 
> .Reserve'd
> ----------------------------------------------------------------------------------
>
>                 Key: ARROW-7985
>                 URL: https://issues.apache.org/jira/browse/ARROW-7985
>             Project: Apache Arrow
>          Issue Type: Bug
>    Affects Versions: 0.15.1
>            Reporter: John Jenkins
>            Assignee: Antoine Pitrou
>            Priority: Major
>
> Here's a reproduction:
> {code:java}
> #include <arrow/builder.h>
> #include <arrow/status.h>
> #include <iostream>
> int main() {
>         arrow::ListBuilder lb(arrow::default_memory_pool(), 
> std::unique_ptr<arrow::ArrayBuilder>(new arrow::Int32Builder()));
>         lb.value_builder()->Reserve(100); // bug
>         lb.Append();
>         std::shared_ptr<arrow::Array> ar;
>         arrow::Status st = lb.Finish(&ar);
>         if (!st.ok()) {
>                 std::cerr << st << '\n';
>                 return 1;
>         }
> }
> {code}
> The output is
> {noformat}
> Invalid: Resize cannot downsize{noformat}
> The Resize call is made at builder_nested.h, line 115. There's a note there 
> about ARROW-2744. Perhaps the fix is to look at capacity rather than length?



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

Reply via email to