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



##########
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:
       Could we provide an unit tests like 
[this](https://github.com/apache/iceberg/blob/d132474e7c8706f504a47f75b58e5a58d0bef9ff/flink/src/test/java/org/apache/iceberg/flink/TestFlinkHiveCatalog.java)
 ?




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