Repository navigation
Open
Labels
P3Backlog: valid, low payoff-per-effortarea:queryQuery execution, planning, fast paths, overlay, result formattingenhancementNew feature or requesttriage:needs-decisionBlocked on a product/design decision
Description
#2010 makes every keyed operator (DISTINCT, GROUP BY, MINUS, EXISTS, trailing VALUES, BIND, OPTIONAL) canonicalize terms through one function, so one IRI met in two encoded forms is one term. Two things are left: nothing stops a new keyed site from hashing raw bindings, and the operators still don't share one compatibility rule for numbers.
- A key type that makes a cross-form comparison impossible to write. A
TermKeynewtype whose only constructor isTermKey::of(&Binding, &EqualityNorm), then either removeHashfromBindingor add adisallowed_typeslint on maps and sets keyed byBinding/Vec<Binding>, so every keyed site has to name it.Binding'sPartialEqstays form-sensitive by design, since it has no store. fix(query): compare terms by what they are, not how they're encoded #2010's census puts the sites at about 18 files: DISTINCT, GROUP BY, MINUS, the dataset dedup, VALUES, the hash join's IRI arms, the group-aggregate key builders, semijoin, subquery, the range semijoin, the membership join, the annotation probe, OPTIONAL's partition and unify, the encoded fast paths ineval/rdf.rsandeval/compare.rs, and BIND. Its estimate is roughly 800–1,500 changed lines, plus a perf pass on DISTINCT, GROUP BY and the hash join, since key construction has to stay allocation-free for encoded forms. Vector literals belong in it too: Vector literals compare by arena handle at DISTINCT / GROUP BY / MINUS #1957 tracks them comparing by arena handle at DISTINCT, GROUP BY and MINUS, along with the two vector threads from fix(query): compare terms by what they are, not how they're encoded #2010's review. - One engine-wide compatibility rule. If fix(query): compare terms by what they are, not how they're encoded #2010's rule stands, OPTIONAL correlates a numeric by value across numeric datatypes, as the inner join does (
OPTIONAL { ?s ?p ?n }with?n = 1also matches"1"^^xsd:long), while EXISTS, MINUS, trailing VALUES, DISTINCT and BIND compare terms. An instance, onmainand with fix(query): compare terms by what they are, not how they're encoded #2010 alike:?t ex:w ?x { BIND(7.0e0 AS ?x) }puts the BIND in a group of its own, so it reaches the pattern through the join and also matches a stored integer7; written in one group,BIND(7.0e0 AS ?x) ?t ex:w ?xmatches the double only. AndsameTerm(1, "1"^^xsd:long)is true, a pre-existing deviation from the spec. Picking one rule (by value or by term) for joins, OPTIONAL and the term-comparing surfaces is a semantics change, so it needs a decision first. Numeric lexical forms are canonicalized at ingest, so01,+1and1become the same term (decision D-11) #1696's lexical-form decision sits right next to it.
The two fit one PR reasonably well, since the rule would live in EqualityNorm, which is what TermKey::of takes.
Related existing issue: #1957.
From #2010 (Not changed here: a key type that makes a cross-form comparison impossible to write; Decision for review: the follow-up compatibility rule).
Metadata
Metadata
Assignees
Labels
P3Backlog: valid, low payoff-per-effortarea:queryQuery execution, planning, fast paths, overlay, result formattingenhancementNew feature or requesttriage:needs-decisionBlocked on a product/design decision
Activity