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

Method Call

cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc:470–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
490template <typename O, typename I>

Callers

nothing calls this directly

Calls 7

ParseYYYY_MM_DDFunction · 0.85
type_singletonFunction · 0.70
InvalidFunction · 0.50
sizeMethod · 0.45
ToStringMethod · 0.45
dataMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected