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

Function CheckTimeZoneDatabaseAvailability

cpp/src/arrow/adapters/orc/adapter.cc:192–204  ·  view source on GitHub ↗

Proactively check timezone database availability for ORC versions older than 2.0.0

Source from the content-addressed store, hash-verified

190#ifdef ARROW_ORC_NEED_TIME_ZONE_DATABASE_CHECK
191// Proactively check timezone database availability for ORC versions older than 2.0.0
192Status CheckTimeZoneDatabaseAvailability() {
193 auto tz_dir = std::getenv("TZDIR");
194 bool is_tzdb_avaiable = tz_dir != nullptr
195 ? std::filesystem::exists(tz_dir)
196 : std::filesystem::exists("/usr/share/zoneinfo");
197 if (!is_tzdb_avaiable) {
198 return Status::Invalid(
199 "IANA time zone database is unavailable but required by ORC."
200 " Please install it to /usr/share/zoneinfo or set TZDIR env to the installed"
201 " directory");
202 }
203 return Status::OK();
204}
205#endif
206
207} // namespace

Callers 1

OpenMethod · 0.85

Calls 2

InvalidFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected