Skip to content

fix(cypher): support connected-prefix carried-scalar reentry (#1004) - #1005

Merged
lmeyerov merged 1 commit into
masterfrom
feat/cypher-carried-scalar-match-reentry
Apr 1, 2026
Merged

lmeyerov merged 1 commit into
masterfrom
feat/cypher-carried-scalar-match-reentry

Conversation

@lmeyerov

@lmeyerov lmeyerov commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Support the narrow direct-Cypher MATCH ... WITH ... MATCH ... continuation where the WITH carries one whole-row alias plus scalar outputs derived from that same alias, even when the prefix MATCH is not a literal single-node seed.

Closes #1004.

Scope

This PR intentionally stays narrow:

  • supports connected-prefix carried-scalar reentry such as MATCH (a)-[:R]->(b) WITH b, b.id AS bid MATCH (b)-[:S]->(c) ...
  • preserves the existing out-of-scope boundaries for broader multi-alias row lowering
  • does not attempt the broader #981 multi-binding projection family
  • does not attempt the broader #999 multi-stage row-carrier architecture

Implementation

  • remove the over-strict lowering guard that required carried-scalar reentry to come from a literal single-node prefix MATCH seed
  • add focused coverage for:
    • connected-prefix carried-scalar reentry
    • multiple carried scalar columns from the same connected prefix
    • cross-alias / multi-alias nearby failfast boundaries
    • cudf execution for the exact new connected-prefix shape

Validation

Local:

  • PYTHONPATH=. pytest -q graphistry/tests/compute/gfql/cypher/test_lowering.py -> 456 passed, 46 skipped
  • PYTHONPATH=. pytest -q graphistry/tests/compute/test_gfql.py -k "reentry" -> 6 passed, 3 skipped, 41 deselected
  • ruff check graphistry/compute/gfql/cypher/lowering.py graphistry/tests/compute/gfql/cypher/test_lowering.py -> pass
  • ./bin/typecheck.sh -> pass

DGX / cuDF:

  • official RAPIDS 26.02 cuda13 targeted run on dgx-spark
  • graphistry/tests/compute/gfql/cypher/test_lowering.py::test_string_cypher_executes_with_match_reentry_carried_scalars_from_connected_prefix_shape_on_cudf -> passed

Benchmark-facing result

Fresh origin/master still hits #973 earlier on official interactive-short-2, so this PR by itself does not change current master benchmark status yet.

But when this change is combined with the closed connected-multihop PR head (6b17cf642), the motivating official query moves past the old single-node prefix MATCH seed blocker and reaches the next boundary:

  • Cypher MATCH after WITH currently supports a single trailing MATCH pattern

So this lane is still a real benchmark unblocker; it just needs the connected-multihop lane underneath it.

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.

Cypher MATCH after WITH carried scalar columns rejects reentry unless the prefix MATCH seed is a single node

1 participant