You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cypher: FOREACH over a runtime list, and CALL { … }, before or among multi-clause writes #2235
Two shapes are refused in a write statement today, on their own and in multi-clause statements:
FOREACH iterates only a constant list (inline literal, constant range(), a $param array): it unrolls during
parameter substitution (fluree-db-cypher/src/params.rs, expand_foreach). A runtime list
(FOREACH (x IN n.tags | SET …)) and a MERGE/DELETE/nested FOREACH body are refused there.
CALL { … } before a write clause is refused by the single-Txn lowering and deferred by the sequential driver
(cypher_seq.rs, validate_members).
Plan:
FOREACH over a runtime list: stage it in the sequential driver as a per-row expansion — evaluate the list per
row in the row table (hoist_clause_value_exprs already turns value expressions into row columns), unnest it
into the table with a row index, and stage the body clauses seeded with the unnested rows, as a SET/REMOVE/CREATE
is seeded today. A body MERGE reuses the driver's MERGE partition; a body DELETE reuses the seeded DELETE.
CALL { … } before the writes: the read prefix already runs as an ordinary read query, which supports CALL { … }; lift the validate_members refusal once a test pins that the subquery's rows seed the writes as a MATCH's rows do (correlated import, and an aggregate in the body).
Tests: twins against the equivalent SPARQL ; update where one exists; routing assertions with detect_sequential.
Perf: statements that use neither shape keep their plans; check set_set_all and merge_chain in the harness.
Activity