apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
14.39k stars 3.5k forks source link

[C++] Return references from DictionaryArray accessor methods #35437

Open benibus opened 1 year ago

benibus commented 1 year ago

Describe the enhancement requested

Several of the DictionaryArray accessor methods (dictionary() and indices()) currently return a std::shared_ptr<Arrray by value. From looking at the implementation, these underlying arrays are owned by the class so it seems possible to return them as a const std::shared_ptr<Array>& instead - keeping with general conventions and reducing potential gotchas.

Component(s)

C++

pitrou commented 1 year ago

It seems like this was done in PR #36418.