MCPcopy Create free account
hub / github.com/apache/arrow / SampleFunction

Function SampleFunction

cpp/examples/arrow/udf_example.cc:53–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 "UDFOptions"};
52
53arrow::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
66arrow::Status Execute() {
67 const std::string name = "add_three";

Callers

nothing calls this directly

Calls 1

OKFunction · 0.50

Tested by

no test coverage detected