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



##########
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:
       Maybe we do not need a unit tests for this, since we use system 
environment to get `HIVE_HOME`. But we don't have a method called 
`System.setEnv` and then get it. I found a method to set in 
https://github.com/stefanbirkner/system-lambda, but it may be too complex. 




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