| 279 | |
| 280 | template <typename ValueType> |
| 281 | static Status Exec(KernelContext* ctx, const ExecSpan& span, ExecResult* result) { |
| 282 | auto state = checked_cast<const RunEndEncodingState*>(ctx->state()); |
| 283 | switch (state->run_end_type->id()) { |
| 284 | case Type::INT16: |
| 285 | return DoExec<Int16Type, ValueType>(ctx, span, result); |
| 286 | case Type::INT32: |
| 287 | return DoExec<Int32Type, ValueType>(ctx, span, result); |
| 288 | case Type::INT64: |
| 289 | return DoExec<Int64Type, ValueType>(ctx, span, result); |
| 290 | default: |
| 291 | break; |
| 292 | } |
| 293 | return Status::Invalid("Invalid run end type: ", *state->run_end_type); |
| 294 | } |
| 295 | |
| 296 | template <typename RunEndType> |
| 297 | static Status DoExecNested(KernelContext* ctx, const ArraySpan& input_array, |