[HUDI-1425] Performance loss with the additional hoodieRecords.isEmpty() in HoodieSparkSqlWriter#write (#2296)
This commit is contained in:
@@ -132,6 +132,12 @@ public class HoodieConfig implements Serializable {
|
||||
return rawValue.map(v -> Boolean.parseBoolean(v.toString())).orElse(null);
|
||||
}
|
||||
|
||||
public <T> boolean getBooleanOrDefault(ConfigProperty<T> configProperty) {
|
||||
Option<Object> rawValue = getRawValue(configProperty);
|
||||
return rawValue.map(v -> Boolean.parseBoolean(v.toString()))
|
||||
.orElse((Boolean) configProperty.defaultValue());
|
||||
}
|
||||
|
||||
public <T> Long getLong(ConfigProperty<T> configProperty) {
|
||||
Option<Object> rawValue = getRawValue(configProperty);
|
||||
return rawValue.map(v -> Long.parseLong(v.toString())).orElse(null);
|
||||
|
||||
Reference in New Issue
Block a user