You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/07/10 15:50:59 UTC

[GitHub] [hudi] xushiyan commented on a diff in pull request #6073: [HUDI-4323] Make database table names optional in sync tool

xushiyan commented on code in PR #6073:
URL: https://github.com/apache/hudi/pull/6073#discussion_r917413831


##########
hudi-sync/hudi-sync-common/src/main/java/org/apache/hudi/sync/common/HoodieSyncConfig.java:
##########
@@ -56,22 +59,14 @@ public class HoodieSyncConfig extends HoodieConfig {
   public static final ConfigProperty<String> META_SYNC_DATABASE_NAME = ConfigProperty
       .key("hoodie.datasource.hive_sync.database")
       .defaultValue("default")
+      .withInferFunction(cfg -> Option.ofNullable(cfg.getString(DATABASE_NAME)))

Review Comment:
   good catch. actually these infer functions were never effective as `ConfigProperty#setDefaultValue(ConfigProperty)` wasn't invoked at all. Also noticed that this can be a bug where `org.apache.hudi.common.config.HoodieConfig#setDefaults` never infer defaults if no default value was set. I can file a separate fix for that.



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org