Skip to content

Commit

Permalink
[fix][dingo-executor] Optimize table data merge logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyuan2024 authored and githubgxll committed Oct 22, 2024
1 parent e72f128 commit 57fc47b
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void fin(int pin, @Nullable Fin fin, Vertex vertex) {
}
Integer docIdIndex = param.getDocumentIdIndex();
List<Long> rightList = cache.stream().map(e ->
(Long) e[param.getDocumentIdIndex()]
(Long) e[docIdIndex]
).collect(Collectors.toList());

if (rightList.isEmpty()) {
Expand Down Expand Up @@ -96,15 +96,14 @@ public void fin(int pin, @Nullable Fin fin, Vertex vertex) {
}
}

for (int i = 0; i < cache.size(); i ++) {
Object[] resTuple = new Object[param.getTable().columns.size() + 1];
for(Pair<Long, Float> doc: docs) {
if (cache.get(i)[docIdIndex] == doc.getKey()){
for(int k = 0; k < cache.get(i).length; k++){
resTuple[k] = cache.get(i)[k];
}
resTuple[resTuple.length -1] = doc.getValue();
Object[] resTuple = new Object[param.getTable().columns.size() + 1];
for (Object[] cacheElement : cache) {
for (Pair<Long, Float> doc : docs) {
if (cacheElement[docIdIndex] == doc.getKey()) {
System.arraycopy(cacheElement, 0, resTuple, 0, cacheElement.length);
resTuple[resTuple.length - 1] = doc.getValue();
edge.transformToNext(param.getContext(), selection.revMap(resTuple));
break;
}
}
}
Expand Down

0 comments on commit 57fc47b

Please sign in to comment.