| 668 | using Arg0Value = typename GetViewType<Arg0Type>::T; |
| 669 | |
| 670 | static Status Exec(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) { |
| 671 | ARROW_DCHECK(batch[0].is_array()); |
| 672 | const ArraySpan& arg0 = batch[0].array; |
| 673 | Status st = Status::OK(); |
| 674 | ArrayIterator<Arg0Type> arg0_it(arg0); |
| 675 | RETURN_NOT_OK( |
| 676 | OutputAdapter<OutType>::Write(ctx, out->array_span_mutable(), [&]() -> OutValue { |
| 677 | return Op::template Call<OutValue, Arg0Value>(ctx, arg0_it(), &st); |
| 678 | })); |
| 679 | return st; |
| 680 | } |
| 681 | }; |
| 682 | |
| 683 | // An alternative to ScalarUnary that Applies a scalar operation with state on |