Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
faf40f2 to
26a400d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93e9ea4c92
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| match results.entry(key) { | ||
| Entry::Occupied(mut occupied) => { | ||
| let existing = occupied.get_mut(); | ||
| existing.doc_count += doc_count; |
There was a problem hiding this comment.
Deduplicate documents before merging decoded composite buckets
When a composite terms source has two encoded values in one document that decode to the same public key (for example, a JSON multivalue [-1, -1.0], whose I64 and F64 forms both resolve to I64(-1)), the new collector creates separate internal buckets and reaches this occupied branch for both. Adding the bucket counts treats them as separate documents, so the result reports doc_count: 2 and merges child-aggregation data twice instead of counting the document once; the values need to be canonicalized/deduplicated per document before counting rather than summing overlapping encoded buckets here.
Useful? React with 👍 / 👎.
This fixes a correctness issue in composte aggregation. But instead of fixing composite, I replaced it with the multi terms aggregation.
The fixed issue is (test is
composite_aggregation_deduplicates_mapped_source_keys)Summary
Run composite aggregations through the multi-terms collector so both share block decoding, tuple expansion, bucket counting, and child-aggregation buffering. This removes the separate recursive composite collector and consolidates the collection logic.
Changes
after-prefix pruning.Benchmark
Composite benefits from the optimized
multi_termsaggregation, but there are edge cases where it consumes more memory.