wgtmac commented on code in PR #40697:
URL: https://github.com/apache/arrow/pull/40697#discussion_r1538490060
##########
cpp/src/arrow/adapters/orc/adapter_test.cc:
##########
@@ -636,6 +638,35 @@ TEST(TestAdapterReadWrite, FieldAttributesRoundTrip) {
AssertSchemaEqual(schema, read_schema, /*check_metadata=*/true);
}
+TEST(TestAdapterReadWrite, ThrowWhenTZDBUnavaiable) {
+ auto orc_version = adapters::orc::OrcVersion::Get();
+ if (orc_version.has_value() && orc_version->major >= 2) {
+ GTEST_SKIP() << "Only ORC pre-2.0.0 versions have the time zone database
check";
+ }
+
+ // Backup the original TZDIR env and set a wrong value by purpose to trigger
the check.
+ const char* tzdir_env_key = "TZDIR";
+ const char* expect_str = "IANA time zone database is unavailable but
required by ORC";
+ auto tzdir_env_backup = std::getenv(tzdir_env_key);
+ ARROW_EXPECT_OK(arrow::internal::SetEnvVar(tzdir_env_key, "/a/b/c/d/e"));
Review Comment:
I didn't notice that. Thanks!
--
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]