kou commented on code in PR #13428:
URL: https://github.com/apache/arrow/pull/13428#discussion_r919736246
##########
cpp/src/gandiva/gdv_function_stubs.cc:
##########
@@ -611,6 +611,51 @@ int32_t gdv_fn_cast_intervalyear_utf8_int32(int64_t
context_ptr, int64_t holder_
auto* holder = reinterpret_cast<gandiva::IntervalYearsHolder*>(holder_ptr);
return (*holder)(context, data, data_len, in1_validity, out_valid);
}
+
+GANDIVA_EXPORT
+gdv_timestamp to_utc_timezone_timestamp(int64_t context, gdv_timestamp
time_miliseconds,
+ const char* timezone, gdv_int32
length) {
+ using std::chrono::milliseconds;
+ using arrow_vendored::date::sys_time;
+ using arrow_vendored::date::time_zone;
+ using arrow_vendored::date::zoned_time;
+ using arrow_vendored::date::locate_zone;
+
+ sys_time <milliseconds> tp {milliseconds{time_miliseconds}};
+ try {
+ const time_zone* local_tz = locate_zone(std::string(timezone, length));
+ gdv_timestamp offset = local_tz->get_info(tp).offset.count()*1000;
+ return time_miliseconds - static_cast<gdv_timestamp>(offset);
+ } catch(...) {
+ gdv_fn_context_set_error_msg(context, "Invalid time zone");
+ return 0;
+ }
+}
+
+GANDIVA_EXPORT
+gdv_timestamp from_utc_timezone_timestamp(gdv_int64 context,
+ gdv_timestamp time_miliseconds,
+ const char* timezone, gdv_int32
length) {
+ using std::chrono::milliseconds;
+ using arrow_vendored::date::sys_time;
+ using arrow_vendored::date::time_zone;
+ using arrow_vendored::date::zoned_time;
+ using arrow_vendored::date::make_zoned;
+
+ sys_time <milliseconds> tp {milliseconds{time_miliseconds}};
+ const zoned_time<milliseconds, const time_zone*> utc_tz =
Review Comment:
OK. Is this the error log?
https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/builds/44007267/job/2upjodye0ip00r66
And is this the fix of the error?
https://github.com/palak-9202/arrow/commit/4c0549526e56866205e4b1baa993b2e3e67241d5
--
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]