Executing compute functions
The Arrow compute library has a global FunctionRegistry
, which allows looking up functions by name and listing what is available to call. The list of available compute functions can also be found in the Arrow documentation at https://arrow.apache.org/docs/cpp/compute.html#available-functions. Let's see how to execute these functions now!
Using the C++ compute library
The compute library is managed as a separate module in the base Arrow package. If you've compiled the library yourself from source, make sure that you've used the ARROW_COMPUTE=ON
option during configuration.
Example 1 – adding a scalar value to an array
Our first example is going to be a simple scalar function call on an array of data, using the same Parquet file as we did previously in the C Data API examples:
- First things first, we need to read the column we want from the Parquet file. We can use the Parquet C++ library to open the file and it provides...