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 2021/11/16 03:35:13 UTC

[GitHub] [hudi] nsivabalan commented on a change in pull request #4003: [HUDI-2734] Setting default metadata enable per engine

nsivabalan commented on a change in pull request #4003:
URL: https://github.com/apache/hudi/pull/4003#discussion_r749874318



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/config/HoodieMetadataConfig.java
##########
@@ -233,10 +237,28 @@ public Builder enableFullScan(boolean enableFullScan) {
       return this;
     }
 
+    public Builder withEngineType(EngineType engineType) {
+      this.engineType = engineType;
+      return this;
+    }
+
     public HoodieMetadataConfig build() {
+      metadataConfig.setDefaultValue(ENABLE, getDefaultMetadataEnable(engineType));
       metadataConfig.setDefaults(HoodieMetadataConfig.class.getName());
       return metadataConfig;
     }
+
+    private boolean getDefaultMetadataEnable(EngineType engineType) {
+      switch (engineType) {
+        case SPARK:
+          return ENABLE.defaultValue();
+        case FLINK:

Review comment:
       flink already has a [separate config](https://github.com/apache/hudi/blob/38b6934352abd27b98332cce005f18102b388679/hudi-flink/src/main/java/org/apache/hudi/configuration/FlinkOptions.java#L94) for metadata. So, by the time it reaches here, config will be set incase of filnk engine.




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