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

Function ResolveTemporalOutput

cpp/src/arrow/compute/kernels/scalar_arithmetic.cc:654–669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652}
653
654Result<TypeHolder> ResolveTemporalOutput(KernelContext*,
655 const std::vector<TypeHolder>& types) {
656 DCHECK_EQ(types[0].id(), types[1].id());
657 const auto& left_type = checked_cast<const TimestampType&>(*types[0]);
658 const auto& right_type = checked_cast<const TimestampType&>(*types[1]);
659 DCHECK_EQ(left_type.unit(), left_type.unit());
660
661 if ((left_type.timezone() == "" || right_type.timezone() == "") &&
662 left_type.timezone() != right_type.timezone()) {
663 return Status::Invalid("Subtraction of zoned and non-zoned times is ambiguous. (",
664 left_type.timezone(), right_type.timezone(), ").");
665 }
666
667 auto type = duration(right_type.unit());
668 return type;
669}
670
671template <typename Op>
672void AddDecimalUnaryKernels(ScalarFunction* func) {

Callers

nothing calls this directly

Calls 5

timezoneMethod · 0.80
InvalidFunction · 0.50
durationFunction · 0.50
idMethod · 0.45
unitMethod · 0.45

Tested by

no test coverage detected