yihua commented on a change in pull request #4458:
URL: https://github.com/apache/hudi/pull/4458#discussion_r779920542
##########
File path:
hudi-kafka-connect/src/main/java/org/apache/hudi/connect/writers/KafkaConnectTransactionServices.java
##########
@@ -185,20 +187,50 @@ private void syncMeta() {
}
private void syncHive() {
- HiveSyncConfig hiveSyncConfig = DataSourceUtils.buildHiveSyncConfig(
- new TypedProperties(connectConfigs.getProps()),
- tableBasePath,
- "PARQUET");
+ HiveSyncConfig hiveSyncConfig = buildSyncConfig(new
TypedProperties(connectConfigs.getProps()), tableBasePath);
+ String url;
+ if (!StringUtils.isNullOrEmpty(hiveSyncConfig.syncMode) &&
HiveSyncMode.of(hiveSyncConfig.syncMode) == HiveSyncMode.HMS) {
+ url = hadoopConf.get(KafkaConnectConfigs.HIVE_METASTORE_URIS);
+ } else {
+ url = hiveSyncConfig.jdbcUrl;
+ }
+
LOG.info("Syncing target hoodie table with hive table("
+ hiveSyncConfig.tableName
+ "). Hive metastore URL :"
- + hiveSyncConfig.jdbcUrl
+ + url
+ ", basePath :" + tableBasePath);
- LOG.info("Hive Sync Conf => " + hiveSyncConfig.toString());
+ LOG.info("Hive Sync Conf => " + hiveSyncConfig);
FileSystem fs = FSUtils.getFs(tableBasePath, hadoopConf);
HiveConf hiveConf = new HiveConf();
hiveConf.addResource(fs.getConf());
LOG.info("Hive Conf => " + hiveConf.getAllProperties().toString());
new HiveSyncTool(hiveSyncConfig, hiveConf, fs).syncHoodieTable();
}
+
+ /**
+ * Build Hive Sync Config
+ */
+ public HiveSyncConfig buildSyncConfig(TypedProperties props, String
tableBasePath) {
Review comment:
If the problem is due to irrelevant classes to Kafka Connect imported
from `DataSourceUtils`, is it possible to move
`DataSourceUtils::buildHiveSyncConfig` to a different/new util class so
buildHiveSyncConfig() can still be reused here, instead of duplicating the code
in hudi-kafka-connect module? Should that solve the problem?
--
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]