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

Method Call

cpp/src/arrow/compute/kernels/scalar_temporal_binary.cc:259–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257
258 template <typename T, typename Arg0, typename Arg1>
259 T Call(KernelContext*, Arg0 arg0, Arg1 arg1, Status*) const {
260 static_assert(std::is_same<T, DayTimeIntervalType::DayMilliseconds>::value, "");
261 auto from = localizer_.template ConvertTimePoint<Duration>(arg0);
262 auto to = localizer_.template ConvertTimePoint<Duration>(arg1);
263 const int32_t num_days =
264 static_cast<int32_t>((floor<days>(to) - floor<days>(from)).count());
265 auto from_time = static_cast<int32_t>(
266 std::chrono::duration_cast<std::chrono::milliseconds>(from - floor<days>(from))
267 .count());
268 auto to_time = static_cast<int32_t>(
269 std::chrono::duration_cast<std::chrono::milliseconds>(to - floor<days>(to))
270 .count());
271 const int32_t num_millis = to_time - from_time;
272 return DayTimeIntervalType::DayMilliseconds{num_days, num_millis};
273 }
274
275 Localizer localizer_;
276};

Callers

nothing calls this directly

Calls 1

countMethod · 0.45

Tested by

no test coverage detected