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



##########
File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
##########
@@ -224,7 +225,11 @@ private static HiveConf createHiveConf(
         } else {
             hadoopConf = getHadoopConfiguration(hadoopConfDir);
         }
-        if (hadoopConf == null) {
+        if (hadoopConf == null && !isNullOrWhitespaceOnly(hadoopConfDir)) {
+            throw new CatalogException(
+                    "Failed to load the hadoop conf from specified path:" + 
hadoopConfDir,
+                    new FileNotFoundException("Path " + hadoopConfDir + " does 
not exist."));

Review comment:
       Another situation is `isNullOrWhitespaceOnly` exists but none of the 
conf files exist in that folder. We should throw exception for that too.

##########
File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
##########
@@ -224,7 +225,11 @@ private static HiveConf createHiveConf(
         } else {
             hadoopConf = getHadoopConfiguration(hadoopConfDir);
         }
-        if (hadoopConf == null) {
+        if (hadoopConf == null && !isNullOrWhitespaceOnly(hadoopConfDir)) {

Review comment:
       These can be merged into the above if/else branches. No need to check 
`isNullOrWhitespaceOnly` again.




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