It's not how you interact with the data in your own C++ code, it's for passing this data to other in-process consumers (libraries etc). While in the example it calls the release function, this is usually just passed to a downstream consumer and it's their responsibility to call it.
I agree that having such an example as the first one is confusing. Given that a large part of the point of Apache Arrow is passing data columnar data between libraries in different languages in memory, it makes some sense.
<rant>The official Arrow C++ implementation is just ergonomic warts, full of `const std::shared_ptr<T>&` bs. Trying to use it to manipulate data always give me headache telling apart WTH is an Array, ArrayData, Buffer, and the typed Array interfaces are barely usable. The original official Rust port inherited all the mis-designs too. On the Rust side someone created arrow2 [0] to fix it.</rant>
This is the extracted Arrow C data interfaces as documented in https://arrow.apache.org/docs/format/CDataInterface.html
It's not how you interact with the data in your own C++ code, it's for passing this data to other in-process consumers (libraries etc). While in the example it calls the release function, this is usually just passed to a downstream consumer and it's their responsibility to call it.
I agree that having such an example as the first one is confusing. Given that a large part of the point of Apache Arrow is passing data columnar data between libraries in different languages in memory, it makes some sense.
The official arrow implementation is already in C++11, not sure what the value proposition of this is.
from a quick glance, https://man-group.github.io/sparrow/basic_usage.html looks infinitely more like a library I want to use than https://arrow.apache.org/cookbook/cpp/basic.html
<rant>The official Arrow C++ implementation is just ergonomic warts, full of `const std::shared_ptr<T>&` bs. Trying to use it to manipulate data always give me headache telling apart WTH is an Array, ArrayData, Buffer, and the typed Array interfaces are barely usable. The original official Rust port inherited all the mis-designs too. On the Rust side someone created arrow2 [0] to fix it.</rant>
And I'm glad there's a good C++ impl too.
[0] https://github.com/jorgecarleitao/arrow2