Skip to content

fix(cypher): support multiple reentry WHERE stages - #1032

Merged
lmeyerov merged 1 commit into
fix/issue-1000-post-with-match-unwindfrom
fix/issue-1000-multi-reentry-where
Apr 3, 2026
Merged

lmeyerov merged 1 commit into
fix/issue-1000-post-with-match-unwindfrom
fix/issue-1000-multi-reentry-where

Conversation

@lmeyerov

@lmeyerov lmeyerov commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Refs #1000

Stacked on #1029.

This Phase 4 slice replaces the single global post-reentry WHERE model with aligned per-stage reentry_wheres, so alternating shapes like MATCH ... WITH ... MATCH ... WHERE ... WITH ... MATCH ... WHERE ... WITH ... RETURN compile and execute correctly.

What landed

  • parser/AST support for one WHERE per post-WITH MATCH stage
  • recursive suffix lowering that preserves and rewrites remaining reentry WHERE clauses stage-by-stage
  • amplification for carried scalars, sparse WHERE placement, empty-result behavior, and second-stage fail-fast boundaries
  • narrow test-local DRY cleanup plus a CHANGELOG.md note

Local validation

  • python3.12 -B -m pytest -q graphistry/tests/compute/gfql/cypher/test_parser.py -k "reentry or unwind" -> 11 passed, 84 deselected
  • python3.12 -B -m pytest -q graphistry/tests/compute/gfql/cypher/test_lowering.py -k "cartesian_dynamic_pattern_property or multi_stage_with_match_reentry_with_intermediate_where or multiple_post_with_where_clauses or post_with_match_collect_unwind_match or issue_1000_ic6_after_phase4_now_stops_at_prefix_scalar_with_reentry_requirement" -> 19 passed, 1 skipped, 613 deselected
  • ruff check graphistry/compute/gfql/cypher/ast.py graphistry/compute/gfql/cypher/parser.py graphistry/compute/gfql/cypher/lowering.py graphistry/tests/compute/gfql/cypher/test_parser.py graphistry/tests/compute/gfql/cypher/test_lowering.py -> passed

Exact IC6 progression

  • previous blocker: Cypher only supports one WHERE clause after post-WITH MATCH
  • current blocker after this PR: Cypher MATCH after WITH currently requires the prefix WITH stage to project exactly one whole-row alias

So this PR is a real GREEN slice, but it is not final #1000 closeout. The next stacked slice should tackle scalar-only prefix WITH ... MATCH ... continuation before the comma-pattern fanout lane.

@lmeyerov
lmeyerov force-pushed the fix/issue-1000-post-with-match-unwind branch from 822d8fd to 5900ecc Compare April 3, 2026 03:18
@lmeyerov
lmeyerov force-pushed the fix/issue-1000-multi-reentry-where branch from 817b253 to 36e1906 Compare April 3, 2026 03:18
@lmeyerov
lmeyerov marked this pull request as ready for review April 3, 2026 08:02
@lmeyerov
lmeyerov merged commit 0ed5a89 into fix/issue-1000-post-with-match-unwind Apr 3, 2026
145 of 171 checks passed
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