zhangjun0x01 commented on a change in pull request #1527:
URL: https://github.com/apache/iceberg/pull/1527#discussion_r497320718
##########
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:
My initial idea was to add a prefix to distinguish it from the actual
hive-site.xml. We can add a .tmp suffix to make users understand that it is
only a temporary file
----------------------------------------------------------------
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]