| 51 | "UDFOptions"}; |
| 52 | |
| 53 | arrow::Status SampleFunction(cp::KernelContext* ctx, const cp::ExecSpan& batch, |
| 54 | cp::ExecResult* out) { |
| 55 | // return x + y + z |
| 56 | const int64_t* x = batch[0].array.GetValues<int64_t>(1); |
| 57 | const int64_t* y = batch[1].array.GetValues<int64_t>(1); |
| 58 | const int64_t* z = batch[2].array.GetValues<int64_t>(1); |
| 59 | int64_t* out_values = out->array_span_mutable()->GetValues<int64_t>(1); |
| 60 | for (int64_t i = 0; i < batch.length; ++i) { |
| 61 | *out_values++ = *x++ + *y++ + *z++; |
| 62 | } |
| 63 | return arrow::Status::OK(); |
| 64 | } |
| 65 | |
| 66 | arrow::Status Execute() { |
| 67 | const std::string name = "add_three"; |