Skip to content

Commit

Permalink
Update previous nits to pass unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Liu committed Mar 14, 2022
1 parent d8895c8 commit 5072901
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;
import org.apache.pinot.common.function.scalar.JsonFunctions;
import org.apache.pinot.spi.config.table.TableConfig;
Expand Down Expand Up @@ -301,7 +300,7 @@ protected void renamePrefixes(GenericRow record) {
if (_prefixesToRename.isEmpty()) {
return;
}
Set<String> fields = record.getFieldToValueMap().keySet();
List<String> fields = new ArrayList<>(record.getFieldToValueMap().keySet());
for (Map.Entry<String, String> entry : _prefixesToRename.entrySet()) {
for (String field : fields) {
String prefix = entry.getKey();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public static void validateIngestionConfig(TableConfig tableConfig, @Nullable Sc
if (MapUtils.isNotEmpty(prefixesToRename)) {
for (String prefix : prefixesToRename.keySet()) {
for (String field : fieldNames) {
Preconditions.checkState(field.startsWith(prefix),
Preconditions.checkState(!field.startsWith(prefix),
"Fields in the schema may not begin with any prefix specified in the prefixesToRename"
+ " config. Name conflict with field: " + field + " and prefix: " + prefix);
}
Expand Down

0 comments on commit 5072901

Please sign in to comment.