Repository navigation
fix(cypher): undirected MATCH wrong-answer + shortestPath/pattern-existence parser (#994, #997, #998) - #1009
Merged
Merged
Conversation
lmeyerov
force-pushed
the
fix/cypher-994-997-998
branch
2 times, most recently
from
April 1, 2026 06:46
1c5e5c8 to
0865bec
Compare
For undirected MATCH patterns, the seed node can be on either side of the stored edge. Detect which side is the seed per-row using the src alias boolean mask, then compute peer_id for the undirected_peer alias. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
) 3 new tests for the undirected MATCH bindings table fix: - incoming edge returns peer not seed - outgoing edge still correct (regression) - bidirectional edges both return peer Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…fast (#997, #998) - shortestPath((a)-[:R*]-(b)) and allShortestPaths() now parse and raise GFQLValidationError("not yet supported") instead of GFQLSyntaxError("Invalid Cypher query syntax") - not((a)-[:R]-(b)), exists { ... }, not exists { ... } pattern existence expressions now detected pre-parse and raise clear GFQLValidationError instead of generic syntax error Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
6 new tests: 3 for shortestPath/allShortestPaths rejection, 3 for pattern existence expression rejection. Changelog updated with #994 fix + #997/#998 parser improvements. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add 4 tests: undirected with multiple edges to same nodes, undirected star graph with multiple peers, undirected self-loop, and pattern existence in WHERE clause. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Superseded by _serialize_binding_ops + orient_edges path from #1008. The binding_ops code path correctly handles undirected edges by doubling them (fwd + rev) in EdgeSemantics.orient_edges. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…dpoints path The alias_endpoints code path in _gfql_bindings_row_table is not called from the Cypher lowering (which uses binding_ops + orient_edges instead). The undirected seed/peer detection was added for #994 but never wired up. Revert to the simpler src/dst join that matches the actual usage. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The fix uses orient_edges (both-direction doubling), not the removed alias_endpoints seed/peer detection approach. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Covers 992f2fc fix where ParameterRef in LIMIT clause would crash _literal_limit_value. Verifies WITH...ORDER BY...LIMIT $n...MATCH reentry is properly rejected with a clear validation error. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
lmeyerov
force-pushed
the
fix/cypher-994-997-998
branch
from
April 1, 2026 07:38
8b8baa4 to
db76e38
Compare
This was referenced May 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three fixes: one correctness bug (#994) and two parser improvements (#997, #998).
#994: Undirected MATCH wrong-answer (CORRECTNESS)
Before:
MATCH (n {id: 1})-[r:KNOWS]-(friend) RETURN friend.idreturned the seed (1) instead of the peer (2) when the stored edge was incoming (s=2, d=1).After: Correctly returns peer (2) regardless of stored edge direction.
Root cause: The multi-alias bindings table (PR #986) joined on static src/dst columns, but for undirected edges the seed can be on either side. Fixed by detecting which endpoint is the seed per-row using the src alias boolean mask.
#997: shortestPath parser (PARSER)
Before:
shortestPath((a)-[:R*]-(b))→ generic "Invalid Cypher query syntax"After: Clear "shortestPath() is not yet supported" validation error
#998: Pattern existence expressions (PARSER)
Before:
not((a)-[:R]-(b)),exists { ... }→ generic syntax errorAfter: Clear "Pattern existence expressions are not yet supported" validation error
Tests (9 new)
GPU validation
All pass on pandas + cudf (dgx-spark, graphistry/test-gpu:latest).
Test plan
🤖 Generated with Claude Code