5herhom commented on code in PR #6257:
URL: https://github.com/apache/hudi/pull/6257#discussion_r934730986


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/utils/HiveSyncContext.java:
##########
@@ -84,6 +84,9 @@ public static HiveSyncContext create(Configuration conf, 
SerializableConfigurati
     org.apache.hadoop.conf.Configuration hadoopConf = 
HadoopConfigurations.getHadoopConf(conf);
     HiveConf hiveConf = new HiveConf();
     hiveConf.addResource(serConf.get());
+    if (!FlinkOptions.isDefaultValueDefined(conf, 
FlinkOptions.HIVE_SYNC_METASTORE_URIS)) {
+      hadoopConf.set(HiveConf.ConfVars.METASTOREURIS.varname, 
conf.getString(FlinkOptions.HIVE_SYNC_METASTORE_URIS));
+    }

Review Comment:
   **buildSyncConfig()** just put config into`HiveSyncContext.props`, but not 
`HiveSyncConfig.hadoopConf`. When running to constructor of HMSDDLExecutor, it 
call `syncConfig.getHiveConf()`  to use the `HiveSyncConfig.hadoopConf`:
   `this.client = Hive.get(syncConfig.getHiveConf()).getMSC();`
   There is no code to put 'hive_sync.metastore.uris' from 
`HiveSyncContext.props` to `syncConfig.getHiveConf()`. Which make an exception 
when use hive sync by metastore.
   
   I found the code is removed in the pull: 
[https://github.com/apache/hudi/pull/5854](url) . I think it causes the error.
   
![image](https://user-images.githubusercontent.com/35916131/182201258-040f7682-07fd-4d80-96c9-e7283f6bacf4.png)
   
   



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