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
There is an error in the usage example of the Compute Function on the official website? #38847
Comments
Hi, I suspect the compute functions are missing from your compilation. Could you paste your CMake output here? |
This is my CMake output: [root@glusterfs-02 build]# cmake .. |
Oh I meant the CMake output for compiling Arrow. Did you compile Arrow yourself or installed a compiled package? |
I compiled Arrow by myself. Here is my CMake output: [root@glusterfs-02 build]# cmake .. Could not find a package configuration file provided by "xsimd" with any of
Add the installation prefix of "xsimd" to CMAKE_PREFIX_PATH or set -- Building xsimd from source -- Arrow version: 15.0.0-SNAPSHOT-- Build configuration summary:
|
Maybe I know the reason, I saw this in the CMake output: Compute-Kernel is disabled by default here. How do I enable it? I didn't find the relevant options in the root CMakeLists. |
You can pass -DARROW_COMPUTE=ON to CMake. Or you can simply use one of the presets for simplicity, see https://arrow.apache.org/docs/dev/developers/cpp/building.html#cmake-presets |
Thank you very much, my problem is solved. However, I think that instructions need to be added to the official use cases. If you want to use the response function when compiling arrow, you need to set the cmake parameters appropriately. |
Describe the usage question you have. Please include as many useful details as possible.
I use Compute Function according to the example on the official website, and can compile successfully, but in the execution is an error: "Key error: No function registered with name: sum"
Here's my code:
#include
#include <arrow/api.h>
#include <arrow/compute/api.h>
using namespace std;
arrow::Status RunMain() {
// Create a couple 32-bit integer arrays.
arrow::Int32Builder int32builder;
int32_t some_nums_raw[5] = {34, 624, 2223, 5654, 4356};
ARROW_RETURN_NOT_OK(int32builder.AppendValues(some_nums_raw, 5));
std::shared_ptrarrow::Array some_nums;
ARROW_ASSIGN_OR_RAISE(some_nums, int32builder.Finish());
}
int main() {
arrow::Status st = RunMain();
if (!st.ok()) {
std::cerr << st << std::endl;
return 1;
}
return 0;
}
Component(s)
C++
The text was updated successfully, but these errors were encountered: