Skip to content

feat(cypher): OPTIONAL MATCH with WITH/UNWIND stages (#1026) - #1044

Merged
lmeyerov merged 4 commits into
masterfrom
fix/issue-1026-optional-match-with-stages
Apr 4, 2026
Merged

lmeyerov merged 4 commits into
masterfrom
fix/issue-1026-optional-match-with-stages

Conversation

@lmeyerov

@lmeyerov lmeyerov commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Support OPTIONAL MATCH queries with interleaved WITH/UNWIND/SKIP/LIMIT stages between clauses (#1026).

Part of the #996 OPTIONAL MATCH umbrella.

Status: WIP — investigation starting.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add optional_reentry flag to CompiledCypherQuery, set when the reentry
MATCH clause is optional. The executor null-fills unmatched prefix rows
so WITH + OPTIONAL MATCH produces left-outer-join semantics instead of
silently dropping unmatched rows.

Known limitation: null-filled rows have all columns null (including
prefix-carried values) because the fill happens after RETURN projection.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
lmeyerov and others added 2 commits April 4, 2026 09:57
… null-fill (#1026)

- Clear empty_result_row when optional_reentry is set to prevent spurious
  null row on empty graphs
- Lock multi-alias WITH rejection as known limitation (#1047)
- Add tests: all-match, property on optional, empty graph, multi-row optional

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@lmeyerov
lmeyerov marked this pull request as ready for review April 4, 2026 17:26
@lmeyerov
lmeyerov merged commit 625f721 into master Apr 4, 2026
68 checks passed
@lmeyerov
lmeyerov deleted the fix/issue-1026-optional-match-with-stages branch April 4, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant