kbendick commented on a change in pull request #1527:
URL: https://github.com/apache/iceberg/pull/1527#discussion_r497256925



##########
File path: flink/src/main/java/org/apache/iceberg/flink/FlinkCatalogFactory.java
##########
@@ -121,4 +135,36 @@ protected Catalog createCatalog(String name, Map<String, 
String> properties, Con
   public static Configuration clusterHadoopConf() {
     return 
HadoopUtils.getHadoopConfiguration(GlobalConfiguration.loadConfiguration());
   }
+
+  private void loadHiveConf(Configuration configuration, Map<String, String> 
properties) {
+    String hiveConfPath = properties.get(HIVE_SITE_PATH);
+    Path path = new Path(hiveConfPath);
+    if (hiveConfPath.startsWith("hdfs")) {
+      download(configuration, path);
+    } else {
+      File file = new File(hiveConfPath);
+      if (!file.exists()) {
+        LOGGER.error("{} doesn't exist. if in application mode ," +
+                " please provide a hdfs path for hive-site.xml", hiveConfPath);
+      } else {
+        configuration.addResource(path);
+      }
+    }
+  }
+
+  private void download(Configuration configuration, Path hdfsHiveSitePath) {
+    try {
+      File tmpFile = File.createTempFile("hive-site.xml-", "");

Review comment:
       Is the temp file `hive-site.xml-` supposed to have that trailing dash? 
Is this possibly a typo?




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