-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C++] Enable Array creation from Scalar #40318
Comments
It seems that we have arrow/cpp/src/arrow/array/util.h Lines 49 to 55 in 6406676
Could you take a look at it? |
That looks exactly like what I was envisioning. I've tested it and it works just as I'd expect. I can't find that function anywhere in the C++ documentation, though. Could we add it somewhere? Perhaps to a factories section on the Arrays page similar to the one that exists for Scalars? |
It makes sense. Could you work on this? |
### Rationale for this change These factory functions are generally useful and available, so documenting them helps external users find them without having to search the source code. ### What changes are included in this PR? This PR adds the array factories in arrow/array/util.h into a doxygen group for array factories and adds that group to the Sphinx C++ API documentation. ### Are these changes tested? I built the docs locally to verify. ### Are there any user-facing changes? Nothing to the API, only docs. * GitHub Issue: #40318 Authored-by: Vyas Ramasubramani <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
Issue resolved by pull request 40373 |
…che#40373) ### Rationale for this change These factory functions are generally useful and available, so documenting them helps external users find them without having to search the source code. ### What changes are included in this PR? This PR adds the array factories in arrow/array/util.h into a doxygen group for array factories and adds that group to the Sphinx C++ API documentation. ### Are these changes tested? I built the docs locally to verify. ### Are there any user-facing changes? Nothing to the API, only docs. * GitHub Issue: apache#40318 Authored-by: Vyas Ramasubramani <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
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:
Apologies if there is such a function somewhere in the C++ and I missed it.
Component(s)
C++
The text was updated successfully, but these errors were encountered: