-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[C++] Enable Array creation from Scalar #40318
Copy link
Copy link
Closed
Description
Describe the enhancement requested
Currently creating an ArrowArray from a Scalar requires going through the Builder interface. While this is fine as a general solution, a common special case is the creation of an Array from a single Scalar (possibly copying that Scalar N times). Abstracting out the handling of different types could be helpful for this case. If there is interest in this feature, there is code that I wrote for this task in cudf that could easily be extracted into arrow C++ (we're likely to remove that functionality from libcudf).
Concretely, this would be something like an API with the signature:
arrow::Array from_scalar(arrow::Scalar const& input, size_type N=1)
Apologies if there is such a function somewhere in the C++ and I missed it.
Component(s)
C++
Reactions are currently unavailable