apache / apache/arrow

[C++] Clarify that RunEndEncodedBuilder::AppendScalar Only Accepts std::shared_ptr<Scalar>

Open
#50,507 1 comment 0 reactions 1 assignee Claimed by @andishgar View on GitHub
Component: C++ Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the enhancement requested

The current API of `arrow::RunEndEncodedBuilder::AppendScalar` is:

```c++
Status AppendScalar(const Scalar& scalar, int64_t n_repeats) override;
```

However, because of [this code](https://github.com/apache/arrow/blob/7932e197eaa00577ff3e83ddf956022df3ef174c/cpp/src/arrow/array/builder_run_end.cc#L102), it effectively only accepts `std::shared_ptr`.

We should either change the API to accept only `std::shared_ptr`, or provide an overload that supports both forms (although I'm not sure whether `Scalar` is intended to be copyable or whether its copy constructor is usable in this context).

### Component(s)

C++

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.