← Back to Pull requests

Document and pin the key order of DEDUP on _source #168538

Open
unknown opened this pull request with 160 lines diff across 2 files
View on GitHub
unknown unknown commented on Dec 03, 2026 01:02 UTC
Author

DEDUP compares a _source column by the bytes loaded for it, so two documents whose JSON holds the same keys and values in a different order are not duplicates. The docs already said so for _source. This also says it for the _unmapped_fields column that unmapped_fields="LOAD_ALL" adds, whose keys are written in the order the fields are found in the document, and pins both with a REST test.

The test, RestEsqlIT#testDedupKeepsARowForEachKeyOrderOfSource, indexes three documents with their key order kept ({"a": 1, "b": 2}, {"b": 2, "a": 1} and {"a": 1, "b": 2}): DEDUP over stored _source and over _unmapped_fields returns two rows, and over the two documents with the same key order it returns one. It is a Java test and not a YAML one because the YAML runner does not keep the order of the keys of a document it indexes. It passes in sync and async mode.

This is a documented limitation, not a goal: the test is there so that a change of this behavior is deliberate. Making DEDUP order-insensitive would mean canonicalizing the key in Dedup.surrogate (parse, sort the object keys, write compact JSON, then project the key away). That should wait for #164589, which also edits Dedup.java.

Relates to #167199, which stays open until this merges.

Diff: 160 lines (+120 / -40) across 2 files Reviewer: kosabogi Review duration: 640m
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.35) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 160 lines diff across 2 files
0.35
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
42%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.304
Real PR Conversation Timeline
1 comments
"Review active on #168538"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 43.0% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 34.8% (LOW) · Higher = larger blast radius
34.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 43.0% · Lower = rushed or shallow review
43.0%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 19.9% · Safe to merge
19.9%