Skip to content

Cypher: relationship alias unsupported in row expression select (blocks IC11 job-referral) #1072

Description

@lmeyerov

Summary

When an IC11-style Cypher query uses a relationship alias (e.g. workAt) in a select row expression, the engine raises an unsupported-token error. This blocks execution of LDBC SNB Interactive Complex Query 11 (IC11 — job-referral).

Error

[invalid-node-reference] Error executing 'select': unsupported token in row expression: 'workAt' | field: function | value: 'select'

Failing Pattern

IC11 matches a friend-of-friend to a company via a WORKS_AT relationship and then projects properties from both the relationship (workAt) and the company node:

MATCH (p:Person {id: $personId})-[:KNOWS*1..2]-(friend:Person),
      (friend)-[workAt:WORKS_AT]->(company:Company)
WHERE workAt.workFrom < $workFromYear
  AND (company)-[:IS_LOCATED_IN]->(:Place {name: $countryName})
RETURN friend.id, friend.firstName, friend.lastName,
       company.name AS organizationName,
       workAt.workFrom AS organizationWorkFromYear
ORDER BY organizationWorkFromYear ASC, friend.lastName ASC, friend.id ASC
LIMIT 10

The workAt relationship alias appears in the RETURN projection, and the engine's select row expression evaluator does not handle relationship aliases — only node aliases are supported.

Relationship to Related Issues

Affected Queries

  • LDBC SNB Interactive Complex 11 (interactive-complex-11.cypher) — job-referral primitive
  • Any Cypher query that projects a relationship alias property in RETURN (e.g. workAt.workFrom)

Provenance

Measured and reported from the pyg-bench SNB Interactive conformance harness.

Activity

  1. lmeyerov commented on May 3, 2026

    @lmeyerov
    ContributorAuthor

    Closed via #1249 (merged at ef42830).

    Implementation summary

    Bare relationship-alias tokens in row expressions (select([("rel", "workAt")]), WHERE rel IS NOT NULL, RETURN rel) now resolve and render as Cypher-style [:TYPE {prop: value, ...}] strings, with cell-for-cell parity between select/where_rows and RETURN <relAlias>.

    Key changes

    • graphistry/compute/gfql/row/pipeline.py::_gfql_resolve_token extends the bare-alias branch with edge-alias resolution: prefer {alias}.{_edge} when present, otherwise dispatch to the new shared vectorized renderer.
    • graphistry/compute/gfql/row/entity_props.py exposes a shared edge-entity renderer reused by cypher/result_postprocess.py::_format_edge_entities and the row-pipeline path.
    • Edge-alias classification is gated on _gfql_rows_edge_aliases metadata propagated through row-table adapters so node-alias frames missing a node-id column are not misrendered as edges.
    • Renderer normalizes string escaping (\\, '), float formatting (strips trailing .0+), and treats blank/whitespace type as absent ([{...}] instead of [: {...}]).
    • Re-entry WHERE secondary-alias property predicates (MATCH ... WITH a, b ... MATCH ... WHERE b.x = ...) are rewritten when the predicate has no expr_tree by synthesizing WHERE expression text from structured predicates and clearing consumed predicates in cypher/lowering.py to avoid stale dual representation.

    Test coverage — added regressions covering string escaping, float normalization, null-only properties, missing/empty type, multi-edge rows, select/return parity, node-alias misclassification guard, bare-alias id parity, cuDF rendering, and re-entry WHERE rewrites on secondary aliases (incl. OR/XOR-around carried+trailing alias property paths).

    Validation

    • Local: row pipeline + cypher tests 1068 passed, 70 skipped; full TCK 3784 passed, 911 xfailed.
    • DGX-Spark (RAPIDS 25.02 + 26.02): targeted PR tests pass on both; broader gfql profile passes (294 on 26.02; 289 on 25.02 with 2 pre-existing flaky cuDF tests deselected for environmental reasons).
    • PR CI: all required checks green at head 577031237.

    Carries

    • #1071 multi-alias carry through WITH before MATCH re-entry — CLOSED via #1247.
    • #1236 OR/XOR-around-pattern WHERE lowering — CLOSED via #1244.
    • Composes cleanly with #1248 (ReentryPlan + multi-whole-row prefix WITH).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions