Skip to content

Commit

Permalink
MINOR: rename ConfigName.RENAME to ConfigName.RENAMES for replaceFiled (
Browse files Browse the repository at this point in the history
#17369)

Reviewers: Andrew Schofield <[email protected]>, TengYao Chi <[email protected]>, Chia-Ping Tsai <[email protected]>
  • Loading branch information
TaiJuWu authored Oct 4, 2024
1 parent 529095b commit 3bb408c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ private static Map<String, Schema.Type> parseFieldTypes(List<String> mappings) {
for (String mapping : mappings) {
final String[] parts = mapping.split(":");
if (parts.length > 2) {
throw new ConfigException(ReplaceField.ConfigName.RENAME, mappings, "Invalid rename mapping: " + mapping);
throw new ConfigException(ReplaceField.ConfigName.RENAMES, mappings, "Invalid rename mapping: " + mapping);
}
if (parts.length == 1) {
Schema.Type targetType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ interface ConfigName {
String EXCLUDE = "exclude";
String INCLUDE = "include";

String RENAME = "renames";
String RENAMES = "renames";
String REPLACE_NULL_WITH_DEFAULT_CONFIG = "replace.null.with.default";
}

Expand All @@ -60,7 +60,7 @@ interface ConfigName {
"Fields to exclude. This takes precedence over the fields to include.")
.define(ConfigName.INCLUDE, ConfigDef.Type.LIST, Collections.emptyList(), ConfigDef.Importance.MEDIUM,
"Fields to include. If specified, only these fields will be used.")
.define(ConfigName.RENAME, ConfigDef.Type.LIST, Collections.emptyList(),
.define(ConfigName.RENAMES, ConfigDef.Type.LIST, Collections.emptyList(),
ConfigDef.LambdaValidator.with(
(name, value) -> {
@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -93,7 +93,7 @@ public void configure(Map<String, ?> configs) {

exclude = new HashSet<>(config.getList(ConfigName.EXCLUDE));
include = new HashSet<>(config.getList(ConfigName.INCLUDE));
renames = parseRenameMappings(config.getList(ConfigName.RENAME));
renames = parseRenameMappings(config.getList(ConfigName.RENAMES));
reverseRenames = invert(renames);
replaceNullWithDefault = config.getBoolean(ConfigName.REPLACE_NULL_WITH_DEFAULT_CONFIG);

Expand All @@ -105,7 +105,7 @@ static Map<String, String> parseRenameMappings(List<String> mappings) {
for (String mapping : mappings) {
final String[] parts = mapping.split(":");
if (parts.length != 2) {
throw new ConfigException(ConfigName.RENAME, mappings, "Invalid rename mapping: " + mapping);
throw new ConfigException(ConfigName.RENAMES, mappings, "Invalid rename mapping: " + mapping);
}
m.put(parts[0], parts[1]);
}
Expand Down

0 comments on commit 3bb408c

Please sign in to comment.