Document and pin the key order of DEDUP on _source #168538
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
kosabogi
DEDUPcompares a_sourcecolumn 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_fieldscolumn thatunmapped_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}):DEDUPover stored_sourceand over_unmapped_fieldsreturns 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
DEDUPorder-insensitive would mean canonicalizing the key inDedup.surrogate(parse, sort the object keys, write compact JSON, then project the key away). That should wait for #164589, which also editsDedup.java.Relates to #167199, which stays open until this merges.