xushiyan commented on code in PR #10099:
URL: https://github.com/apache/hudi/pull/10099#discussion_r1400123695
##########
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncTool.java:
##########
@@ -103,15 +103,29 @@ public class HiveSyncTool extends HoodieSyncTool
implements AutoCloseable {
public HiveSyncTool(Properties props, Configuration hadoopConf) {
super(props, hadoopConf);
- String metastoreUris = props.getProperty(METASTORE_URIS.key());
- // Give precedence to HiveConf.ConfVars.METASTOREURIS if it is set.
- // Else if user has provided HiveSyncConfigHolder.METASTORE_URIS, then set
that in hadoop conf.
- if (isNullOrEmpty(hadoopConf.get(HiveConf.ConfVars.METASTOREURIS.varname))
&& nonEmpty(metastoreUris)) {
- LOG.info(String.format("Setting %s = %s",
HiveConf.ConfVars.METASTOREURIS.varname, metastoreUris));
- hadoopConf.set(HiveConf.ConfVars.METASTOREURIS.varname, metastoreUris);
+ String configuredMetastoreUris = props.getProperty(METASTORE_URIS.key());
+ String existingHadoopConfMetastoreUris =
hadoopConf.get(HiveConf.ConfVars.METASTOREURIS.varname);
Review Comment:
instantiating hive sync tool with a new hadoop conf is not a perf/memory
sensitive path, isn't it? i think the cost of new Configuration() should be
negligible in this scenario so simplifying logic should be preferred over minor
optimizations
--
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]