Skip to content

Commit

Permalink
fix: duplicate key Exception when export data from excel into Hive (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieYan24 authored Jul 22, 2023
1 parent 7cf85a9 commit 1887d51
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public Map<String, String> getParams() {
return Arrays.stream(fileSplits)
.map(FileSplit::getParams)
.flatMap(map -> map.entrySet().stream())
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
.collect(
Collectors.toMap(
Map.Entry::getKey, Map.Entry::getValue, (existingValue, newValue) -> newValue));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public Integer apply(Feature t, Integer count) {
ftCounts.compute(label.getFeature(), countFunction);
return Pair.of(String.valueOf(label.getId()), label);
})
.collect(Collectors.toMap(Pair::getKey, Pair::getRight));
.collect(
Collectors.toMap(
Pair::getKey, Pair::getRight, (existingValue, newValue) -> newValue));

for (Map.Entry<ServiceInstance, List<PersistenceLabel>> entry : outNodeDegree.entrySet()) {
ServiceInstance node = entry.getKey();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public void validate(
Object keyValue = parameters.get(def.getKey());
parameters.put(def.getKey(), keyValue);
return keyValue;
}));
},
(existingValue, newValue) -> newValue));
for (DataSourceParamKeyDefinition def : paramKeyDefinitions) {
// Deal with cascade relation
boolean needValidate = false;
Expand Down

0 comments on commit 1887d51

Please sign in to comment.