Proactively check timezone database availability for ORC versions older than 2.0.0
| 190 | #ifdef ARROW_ORC_NEED_TIME_ZONE_DATABASE_CHECK |
| 191 | // Proactively check timezone database availability for ORC versions older than 2.0.0 |
| 192 | Status 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 |