[HUDI-4124] Add valid check in Spark Datasource configs (#5637)
Co-authored-by: wangzixuan.wzxuan <wangzixuan.wzxuan@bytedance.com>
This commit is contained in:
@@ -44,6 +44,13 @@ import static org.apache.hudi.config.HoodieHBaseIndexConfig.PUT_BATCH_SIZE;
|
||||
import static org.apache.hudi.config.HoodieHBaseIndexConfig.TABLENAME;
|
||||
import static org.apache.hudi.config.HoodieHBaseIndexConfig.ZKPORT;
|
||||
import static org.apache.hudi.config.HoodieHBaseIndexConfig.ZKQUORUM;
|
||||
import static org.apache.hudi.index.HoodieIndex.IndexType.BLOOM;
|
||||
import static org.apache.hudi.index.HoodieIndex.IndexType.BUCKET;
|
||||
import static org.apache.hudi.index.HoodieIndex.IndexType.GLOBAL_BLOOM;
|
||||
import static org.apache.hudi.index.HoodieIndex.IndexType.GLOBAL_SIMPLE;
|
||||
import static org.apache.hudi.index.HoodieIndex.IndexType.HBASE;
|
||||
import static org.apache.hudi.index.HoodieIndex.IndexType.INMEMORY;
|
||||
import static org.apache.hudi.index.HoodieIndex.IndexType.SIMPLE;
|
||||
|
||||
/**
|
||||
* Indexing related config.
|
||||
@@ -57,7 +64,10 @@ public class HoodieIndexConfig extends HoodieConfig {
|
||||
|
||||
public static final ConfigProperty<String> INDEX_TYPE = ConfigProperty
|
||||
.key("hoodie.index.type")
|
||||
// Builder#getDefaultIndexType has already set it according to engine type
|
||||
.noDefaultValue()
|
||||
.withValidValues(HBASE.name(), INMEMORY.name(), BLOOM.name(), GLOBAL_BLOOM.name(),
|
||||
SIMPLE.name(), GLOBAL_SIMPLE.name(), BUCKET.name())
|
||||
.withDocumentation("Type of index to use. Default is Bloom filter. "
|
||||
+ "Possible options are [BLOOM | GLOBAL_BLOOM |SIMPLE | GLOBAL_SIMPLE | INMEMORY | HBASE | BUCKET]. "
|
||||
+ "Bloom filters removes the dependency on a external system "
|
||||
@@ -141,6 +151,7 @@ public class HoodieIndexConfig extends HoodieConfig {
|
||||
public static final ConfigProperty<String> BLOOM_FILTER_TYPE = ConfigProperty
|
||||
.key("hoodie.bloom.index.filter.type")
|
||||
.defaultValue(BloomFilterTypeCode.DYNAMIC_V0.name())
|
||||
.withValidValues(BloomFilterTypeCode.SIMPLE.name(), BloomFilterTypeCode.DYNAMIC_V0.name())
|
||||
.withDocumentation("Filter type used. Default is BloomFilterTypeCode.DYNAMIC_V0. "
|
||||
+ "Available values are [BloomFilterTypeCode.SIMPLE , BloomFilterTypeCode.DYNAMIC_V0]. "
|
||||
+ "Dynamic bloom filters auto size themselves based on number of keys.");
|
||||
|
||||
Reference in New Issue
Block a user