lesterfan opened a new issue, #45532:
URL: https://github.com/apache/arrow/issues/45532

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   `RunEndEncodedBuilder->Finish()` doesn't properly reset the builder state 
when called as specified by the 
[docstring](https://github.com/apache/arrow/blob/6a47e4d28cdc4592fe6a458dbe5efe3b17a090e5/cpp/src/arrow/array/builder_base.h#L201).
 Additionally, the function isn't idempotent and crashes the program when 
called twice.
   ```
   ASSERT_OK_AND_ASSIGN(std::shared_ptr<ArrayBuilder> builder, 
MakeBuilder(ree_type));
   ASSERT_OK(builder->AppendNull());
   ASSERT_EQ(builder->length(), 1);
   ASSERT_OK(builder->Finish());
   ASSERT_EQ(builder->length(), 0); // Fails: the length is still 1
   ASSERT_OK(builder->Finish());
   '_error_or_value190.status()' failed with Invalid: Run-end encoded array has 
non-zero length 516, but run ends array has zero length
   ```
   
   ### Component(s)
   
   C++


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

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

Reply via email to