aucahuasi commented on a change in pull request #11075:
URL: https://github.com/apache/arrow/pull/11075#discussion_r702001646
##########
File path: cpp/src/arrow/compute/kernels/scalar_temporal.cc
##########
@@ -588,8 +701,58 @@ inline std::array<int64_t, 3> GetIsoCalendar(int64_t arg,
Localizer&& localizer)
static_cast<int64_t>(weekday(ymd).iso_encoding())};
}
-template <typename Duration>
+template <typename Duration, typename InType>
struct ISOCalendar {
Review comment:
Thanks @lidavidm !
I think the provided implementation (using specialization) is good enough.
Please note that this function is returning a const ref string:
`const std::string& GetInputTimezone`
So the compiler will throw an error if we want to return local empty strings.
And if I change the declaration to return a `string` (without const ref) we
will be copying the timezones instead of using the refs.
Also, for the case of `ISOCalendar` with `TimestampType` we had this code:
`string timezone = GetInputTimezone`
and we had been performing a copy.
So I changed that to
`const auto& timezone = GetInputTimezone`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]