Github user grundprinzip commented on a diff in the pull request: https://github.com/apache/orc/pull/142#discussion_r131192257 --- Diff: c++/src/Timezone.cc --- @@ -735,18 +739,36 @@ namespace orc { * Get the local timezone. */ const Timezone& getLocalTimezone() { +#ifdef TZ_DB_STATIC_TZ +#define TZ_STR(x) #x + return getTimezoneByName(TZ_STR(TZ_DB_STATIC_TZ)); +#else return getTimezoneByFilename(LOCAL_TIMEZONE); +#endif } /** * Get a timezone by name (eg. America/Los_Angeles). * Results are cached. */ const Timezone& getTimezoneByName(const std::string& zone) { +#ifdef USE_TZ_DB + { + std::lock_guard<std::mutex> timezone_lock(timezone_mutex); + std::map<std::string, std::shared_ptr<Timezone> >::iterator itr = + timezoneCache.find(zone); + if (itr != timezoneCache.end()) { + return *(itr->second).get(); + } + timezoneCache[zone] = std::shared_ptr<Timezone>(new TimezoneImpl(zone, TZ_DATABASE[zone])); --- End diff -- Done
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---