| 468 | |
| 469 | template <typename OutValue, typename Arg0Value> |
| 470 | OutValue Call(KernelContext* ctx, Arg0Value val, Status* st) const { |
| 471 | OutValue result = OutValue(0); |
| 472 | |
| 473 | if (ARROW_PREDICT_FALSE(val.size() != 10)) { |
| 474 | *st = Status::Invalid("Failed to parse string: '", val, "' as a scalar of type ", |
| 475 | TypeTraits<DateType>::type_singleton()->ToString()); |
| 476 | return result; |
| 477 | } |
| 478 | |
| 479 | duration_type since_epoch; |
| 480 | if (ARROW_PREDICT_FALSE(!ParseYYYY_MM_DD(val.data(), &since_epoch))) { |
| 481 | *st = Status::Invalid("Failed to parse string: '", val, "' as a scalar of type ", |
| 482 | TypeTraits<DateType>::type_singleton()->ToString()); |
| 483 | } else { |
| 484 | result = static_cast<value_type>(since_epoch.count()); |
| 485 | } |
| 486 | return result; |
| 487 | } |
| 488 | }; |
| 489 | |
| 490 | template <typename O, typename I> |
nothing calls this directly
no test coverage detected