openinx commented on a change in pull request #1659:
URL: https://github.com/apache/iceberg/pull/1659#discussion_r512369864



##########
File path: flink/src/main/java/org/apache/iceberg/flink/FlinkCatalogFactory.java
##########
@@ -144,6 +144,11 @@ private static Configuration mergeHiveConf(Configuration 
hadoopConf, String hive
       URL configFile = 
CatalogLoader.class.getClassLoader().getResource("hive-site.xml");
       if (configFile != null) {
         newConf.addResource(configFile);
+      } else {
+        // If can not find hive-site.xml from classpath, then try to load 
resource from system env.
+        // this would be useful if don't set `hive-conf-dir` key in ddl.
+        String hiveHome = System.getenv("HIVE_HOME");
+        newConf.addResource(new Path(hiveHome + "/conf/hive-site.xml"));

Review comment:
       There's a `org.apache.flink.core.testutils.CommonTestUtils` from flink 
testutils, which could set the environment for testing purpose.   You may 
follow the demo 
[here](https://github.com/apache/flink/blob/dffa19b85bbe16946c960d9dfe0a2c2f26a0757b/flink-filesystems/flink-hadoop-fs/src/test/java/org/apache/flink/runtime/fs/hdfs/HadoopConfigLoadingTest.java#L253).




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to