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

Function ExecStateful

cpp/src/arrow/compute/exec_test.cc:991–1004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

989}
990
991Status ExecStateful(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) {
992 // We take the value from the state and multiply the data in batch[0] with it
993 ExampleState* state = static_cast<ExampleState*>(ctx->state());
994 int32_t multiplier = checked_cast<const Int32Scalar&>(*state->value).value;
995
996 const ArraySpan& arg0 = batch[0].array;
997 ArraySpan* out_arr = out->array_span_mutable();
998 const int32_t* arg0_data = arg0.GetValues<int32_t>(1);
999 int32_t* dst = out_arr->GetValues<int32_t>(1);
1000 for (int64_t i = 0; i < arg0.length; ++i) {
1001 dst[i] = arg0_data[i] * multiplier;
1002 }
1003 return Status::OK();
1004}
1005
1006Status ExecAddInt32(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) {
1007 const int32_t* left_data = batch[0].array.GetValues<int32_t>(1);

Callers

nothing calls this directly

Calls 2

OKFunction · 0.50
stateMethod · 0.45

Tested by

no test coverage detected