Skip to content

fix(cypher): support expression-valued pattern properties - #1027

Merged
lmeyerov merged 4 commits into
masterfrom
fix/issue-1000-dynamic-pattern-properties
Apr 3, 2026
Merged

lmeyerov merged 4 commits into
masterfrom
fix/issue-1000-dynamic-pattern-properties

Conversation

@lmeyerov

@lmeyerov lmeyerov commented Apr 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • support expression-valued Cypher pattern property maps in local direct Cypher
  • rewrite reentry-carried identifiers inside pattern property maps onto hidden reentry columns
  • fix the adjacent same-path alias-frame materialization bug exposed by the new runtime coverage
  • harden dynamic pattern-property lowering for standalone row predicates, cartesian bindings-table execution, and multi-alias row-scope execution

Scope

This is Phase 1 of #1000, carved out from the umbrella draft PR #1022.

What it covers:

  • MATCH (a)-[:R]->(b {num: a.num})
  • non-property expressions like MATCH (a)-[:R]->(b {num: a.num + 0})
  • cartesian node-only dynamic maps like MATCH (a:A), (b:B {num: a.num})
  • MATCH (a)-[r:R {weight: a.num}]->(b) lowering and runtime
  • reentry-carried identifier maps like MATCH (b {id: bid})
  • reentry-carried relationship property maps like MATCH (b)-[rel:S {score: bscore}]->(c)
  • same-path runtime correctness for alias comparisons like WHERE b.num = a.num

What it does not cover yet:

  • WITH after post-WITH MATCH WHERE
  • UNWIND between reentry stages
  • the remaining IC6 comma-pattern reentry fanout around post

Amplification findings

The follow-on amplification on this branch found three additional Phase 1 bugs and fixed them here:

  • dynamic pattern-property row predicates were being dropped unless the query also had an explicit WHERE
  • multi-alias dynamic row predicates were not switching to bindings-table rows, so valid expressions were rejected by row-scope validation
  • cartesian node-only dynamic pattern-property joins could either crash or ignore the dynamic filter in aggregate/general row-projection paths because that lane still treated them like same-path where= constraints instead of bindings-table row predicates

Links

Testing

  • python3.12 -B -m pytest -q graphistry/tests/compute/gfql/cypher/test_parser.py -k 'linear_pattern_with_labels_properties_and_aliases or expression_valued_pattern_property_entry or identifier_valued_pattern_property_entry or relationship_expression_valued_pattern_property_entry'
  • python3.12 -B -m pytest -q graphistry/tests/compute/gfql/cypher/test_lowering.py -k 'same_path_alias_comparison_where_runtime or preserves_alias_frames_for_same_path_multi_column_projection or same_path_expression_valued_pattern_property or keeps_literal_pattern_filters_alongside_dynamic_property_entries or falls_back_to_row_where_for_non_property_dynamic_pattern_expression or non_property_dynamic_pattern_expression_runtime or relationship_expression_valued_pattern_property or relationship_expression_valued_pattern_property_runtime or reentry_identifier_valued_pattern_property or reentry_relationship_expression_valued_pattern_property or cartesian_dynamic_pattern_property or cartesian_property_join_to_row_where_expression'
  • ruff check graphistry/compute/gfql/cypher/lowering.py graphistry/tests/compute/gfql/cypher/test_parser.py graphistry/tests/compute/gfql/cypher/test_lowering.py

Benchmark status

The exact official IC6 query now gets past the original syntax failure on t:Tag{id: knownTagId} and still stops at the next planned barrier:

  • Cypher WITH after post-WITH MATCH WHERE is not yet supported in the current GFQL Cypher compiler

@lmeyerov
lmeyerov force-pushed the fix/issue-1000-dynamic-pattern-properties branch from 5baaf5e to 2a50cfc Compare April 3, 2026 03:18
@lmeyerov
lmeyerov merged commit cec32d1 into master Apr 3, 2026
101 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