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

Method Call

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

Source from the content-addressed store, hash-verified

421 : type(type), expect_timezone(!type.timezone().empty()) {}
422 template <typename OutValue, typename Arg0Value>
423 OutValue Call(KernelContext*, Arg0Value val, Status* st) const {
424 OutValue result = 0;
425 bool zone_offset_present = false;
426 if (ARROW_PREDICT_FALSE(!ParseTimestampISO8601(val.data(), val.size(), type.unit(),
427 &result, &zone_offset_present))) {
428 *st = Status::Invalid("Failed to parse string: '", val, "' as a scalar of type ",
429 type.ToString());
430 }
431 if (zone_offset_present != expect_timezone) {
432 if (expect_timezone) {
433 *st = Status::Invalid(
434 "Failed to parse string: '", val, "' as a scalar of type ", type.ToString(),
435 ": expected a zone offset. If these timestamps "
436 "are in local time, cast to timestamp without timezone, then "
437 "call assume_timezone.");
438 } else {
439 *st = Status::Invalid("Failed to parse string: '", val, "' as a scalar of type ",
440 type.ToString(), ": expected no zone offset.");
441 }
442 }
443 return result;
444 }
445
446 const TimestampType& type;
447 bool expect_timezone;

Callers

nothing calls this directly

Calls 6

ParseTimestampISO8601Function · 0.85
InvalidFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
unitMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected