lirui-apache commented on a change in pull request #15274:
URL: https://github.com/apache/flink/pull/15274#discussion_r597675943



##########
File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
##########
@@ -217,12 +218,27 @@ private static HiveConf createHiveConf(
                     HadoopUtils.possibleHadoopConfPaths(
                             new 
org.apache.flink.configuration.Configuration())) {
                 hadoopConf = getHadoopConfiguration(possibleHadoopConfPath);
-                if (hadoopConf != null) {
+                if (hadoopConf != null && hadoopConf.size() != 0) {

Review comment:
       Why do we check the size of the conf? Note that `size()` is the number 
of keys in the configuration, not the added resources.

##########
File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
##########
@@ -217,12 +218,27 @@ private static HiveConf createHiveConf(
                     HadoopUtils.possibleHadoopConfPaths(
                             new 
org.apache.flink.configuration.Configuration())) {
                 hadoopConf = getHadoopConfiguration(possibleHadoopConfPath);
-                if (hadoopConf != null) {
+                if (hadoopConf != null && hadoopConf.size() != 0) {
                     break;
                 }
             }
         } else {
             hadoopConf = getHadoopConfiguration(hadoopConfDir);
+            if (hadoopConf == null) {
+                throw new CatalogException(
+                        "Failed to load the hadoop conf from specified path:" 
+ hadoopConfDir,
+                        new FileNotFoundException("Path " + hadoopConfDir + " 
does not exist."));
+            }
+            if (hadoopConf.size() == 0) {

Review comment:
       Same here.




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


Reply via email to