codope commented on code in PR #5637:
URL: https://github.com/apache/hudi/pull/5637#discussion_r882337916
##########
hudi-common/src/main/java/org/apache/hudi/common/config/ConfigProperty.java:
##########
@@ -95,33 +99,46 @@ Option<Function<HoodieConfig, Option<T>>> getInferFunc() {
return inferFunction;
}
+ public void checkValues(String value) {
+ if (validValues != null && !validValues.isEmpty() &&
!validValues.contains(value)) {
+ throw new IllegalArgumentException(
+ "The value of " + key + " should be one of "
+ + String.join(",", validValues) + ", but was " + value);
+ }
+ }
+
public List<String> getAlternatives() {
return Arrays.asList(alternatives);
}
public ConfigProperty<T> withDocumentation(String doc) {
Objects.requireNonNull(doc);
- return new ConfigProperty<>(key, defaultValue, doc, sinceVersion,
deprecatedVersion, inferFunction, alternatives);
+ return new ConfigProperty<>(key, defaultValue, doc, sinceVersion,
deprecatedVersion, inferFunction, validValues, alternatives);
+ }
+
+ public ConfigProperty<T> withValidValues(List<String> validValues) {
Review Comment:
Why List? Why not Set?
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieIndexConfig.java:
##########
@@ -57,7 +64,11 @@ public class HoodieIndexConfig extends HoodieConfig {
public static final ConfigProperty<String> INDEX_TYPE = ConfigProperty
.key("hoodie.index.type")
- .noDefaultValue()
+ .defaultValue(SIMPLE.name())
Review Comment:
There is already `HoodieIndexConfig#getDefaultIndexType` method which sets
default which gets called by the builder. That method sets value based on
execution engine. Why are we setting default here? I am not sure simple index
(which relies on spark lean join) would work with flink. cc @danny0405
--
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]