Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid global ordinals in composite aggregation #74559

Merged
merged 18 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
* A specialized {@link PriorityQueue} implementation for composite buckets.
Expand Down Expand Up @@ -230,13 +232,23 @@ LeafBucketCollector getLeafCollector(Comparable forceLeadSourceValue,
LeafReaderContext context, LeafBucketCollector in) throws IOException {
int last = arrays.length - 1;
LeafBucketCollector collector = in;
boolean requiresRehashing = false;
ywelsch marked this conversation as resolved.
Show resolved Hide resolved
while (last > 0) {
collector = arrays[last--].getLeafCollector(context, collector);
SingleDimensionValuesSource<?> valuesSource = arrays[last--];
requiresRehashing |= valuesSource.requiresRehashingWhenSwitchingLeafReaders();
collector = valuesSource.getLeafCollector(context, collector);
}
SingleDimensionValuesSource<?> valuesSource = arrays[last];
requiresRehashing |= valuesSource.requiresRehashingWhenSwitchingLeafReaders();
if (forceLeadSourceValue != null) {
collector = arrays[last].getLeafCollector(forceLeadSourceValue, context, collector);
collector = valuesSource.getLeafCollector(forceLeadSourceValue, context, collector);
} else {
collector = arrays[last].getLeafCollector(context, collector);
collector = valuesSource.getLeafCollector(context, collector);
}
if (requiresRehashing) {
ywelsch marked this conversation as resolved.
Show resolved Hide resolved
List<Map.Entry<Slot, Integer>> entries = map.entrySet().stream().collect(Collectors.toList());
map.clear();
entries.forEach(e -> map.put(e.getKey(), e.getValue()));
}
return collector;
}
Expand Down

This file was deleted.

Loading