Hisoka-X commented on code in PR #7733:
URL: https://github.com/apache/seatunnel/pull/7733#discussion_r1774354330


##########
seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreProxy.java:
##########
@@ -42,53 +40,53 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
+import java.nio.file.DirectoryStream;
 import java.nio.file.Files;
+import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
 
 @Slf4j
 public class HiveMetaStoreProxy {
     private HiveMetaStoreClient hiveMetaStoreClient;
     private static volatile HiveMetaStoreProxy INSTANCE = null;
-    private static final List<String> HADOOP_CONF_FILES = 
ImmutableList.of("hive-site.xml");
 
     private HiveMetaStoreProxy(ReadonlyConfig readonlyConfig) {
         String metastoreUri = 
readonlyConfig.get(HiveSourceOptions.METASTORE_URI);
         String hiveHadoopConfigPath = 
readonlyConfig.get(HiveConfig.HADOOP_CONF_PATH);
         String hiveSitePath = readonlyConfig.get(HiveConfig.HIVE_SITE_PATH);
-        HiveConf hiveConf = new HiveConf();
-        hiveConf.set("hive.metastore.uris", metastoreUri);
+        Configuration hadoopConf = new Configuration();
         try {
             if (StringUtils.isNotBlank(hiveHadoopConfigPath)) {
-                HADOOP_CONF_FILES.forEach(
-                        confFile -> {
-                            java.nio.file.Path path = 
Paths.get(hiveHadoopConfigPath, confFile);
-                            if (Files.exists(path)) {
-                                try {
-                                    hiveConf.addResource(path.toUri().toURL());
-                                } catch (IOException e) {
-                                    log.warn(
-                                            "Error adding Hadoop resource {}, 
resource was not added",
-                                            path,
-                                            e);
-                                }
-                            }
-                        });
+                getConfigFiles(hiveHadoopConfigPath)

Review Comment:
   It looks OK, can you provide some screenshots of it running successfully?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to