Skip to content

Commit a906f47

Browse files
committed
fix to use enum class value for default value in flinkoptions
1 parent 419f881 commit a906f47

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/configuration/FlinkOptions.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@
2525
import org.apache.hudi.common.model.EventTimeAvroPayload;
2626
import org.apache.hudi.common.model.HoodieCleaningPolicy;
2727
import org.apache.hudi.common.model.HoodieTableType;
28+
import org.apache.hudi.common.model.WriteOperationType;
2829
import org.apache.hudi.config.HoodieIndexConfig;
2930
import org.apache.hudi.config.HoodieWriteConfig;
3031
import org.apache.hudi.exception.HoodieException;
3132
import org.apache.hudi.hive.MultiPartKeysValueExtractor;
33+
import org.apache.hudi.hive.ddl.HiveSyncMode;
3234
import org.apache.hudi.index.HoodieIndex;
3335
import org.apache.hudi.keygen.constant.KeyGeneratorOptions;
3436
import org.apache.hudi.keygen.constant.KeyGeneratorType;
37+
import org.apache.hudi.table.action.cluster.ClusteringPlanPartitionFilterMode;
3538

3639
import org.apache.flink.configuration.ConfigOption;
3740
import org.apache.flink.configuration.ConfigOptions;
@@ -294,7 +297,7 @@ private FlinkOptions() {
294297
public static final ConfigOption<String> OPERATION = ConfigOptions
295298
.key("write.operation")
296299
.stringType()
297-
.defaultValue("upsert")
300+
.defaultValue(WriteOperationType.UPSERT.value())
298301
.withDescription("The write operation, that this write should do");
299302

300303
/**
@@ -656,7 +659,7 @@ private FlinkOptions() {
656659
public static final ConfigOption<String> CLUSTERING_PLAN_PARTITION_FILTER_MODE_NAME = ConfigOptions
657660
.key("clustering.plan.partition.filter.mode")
658661
.stringType()
659-
.defaultValue("NONE")
662+
.defaultValue(ClusteringPlanPartitionFilterMode.NONE.name())
660663
.withDescription("Partition filter mode used in the creation of clustering plan. Available values are - "
661664
+ "NONE: do not filter table partition and thus the clustering plan will include all partitions that have clustering candidate."
662665
+ "RECENT_DAYS: keep a continuous range of partitions, worked together with configs '" + DAYBASED_LOOKBACK_PARTITIONS.key() + "' and '"
@@ -725,8 +728,8 @@ private FlinkOptions() {
725728
public static final ConfigOption<String> HIVE_SYNC_MODE = ConfigOptions
726729
.key("hive_sync.mode")
727730
.stringType()
728-
.defaultValue("hms")
729-
.withDescription("Mode to choose for Hive ops. Valid values are hms, jdbc and hiveql, default 'jdbc'");
731+
.defaultValue(HiveSyncMode.HMS.name())
732+
.withDescription("Mode to choose for Hive ops. Valid values are hms, jdbc and hiveql, default 'hms'");
730733

731734
public static final ConfigOption<String> HIVE_SYNC_USERNAME = ConfigOptions
732735
.key("hive_sync.username")

0 commit comments

Comments
 (0)