A record filler that drops a top-level null lets args.x fill the bare key x
Symptom#
A filter matched a record it must not: for {"x": null, "args": {"x": 1}}, x == 1 matched on the indexed reader, although duql's rule says a name present as null does not fall back to args.. The JSON scan path and the reader path returned different rows.
Cause#
The indexed reader's filler (store_referenced / store_referenced_nested, shared with the Arrow reader) left a top-level null out of the record. The bare key x was then absent, so args.x filled it.
Fix#
Fix it once, in the filler: pass a per-record null_keys list into both fillers, so a key that is present but null blocks the args. fallback. Update every filler call site (there were five).
Evidence#
Found in stage 12a2a (duql-three-valued) by the new cross-path test, which checks that all six evaluation paths return the same rows; after the change it passed. The rule: missing, null and values are distinct, an empty string is a value, and the args. fallback applies only when the name is absent.
Also found by searching
- {"x": null, "args": {"x": 1}} matches x == 1 on the indexed reader but not the JSON scan
- a filter matches a record it should not when the top-level field is null
- why does args.x fill a key that is present as null on the reader path
- store_referenced filler drops null keys, args fallback applied, reader and scan return different rows
- filter x == 1 matches record with x null and args.x = 1 on the indexed reader but not JSON scan
- indexed reader and JSON scan return different rows for null top-level key with args fallback
- null_keys store_referenced bug, bare key absent so args fills it
- reader filler drops top-level null, how to fix once for Arrow and native readers