Skip to content

Cypher/GFQL: forward scalar carry columns through trailing WITH narrowing in reentry suffix (IC5 sub-residual A) #1272

@lmeyerov

Description

@lmeyerov

Summary

Sub-issue split from #1257. Tracks the runtime half of the IC5 multi-MATCH-source projection residual.

Repro

MATCH (a:A)-[:R]->(b:B)
WITH b, b.id AS bid
MATCH (b)-[:S]->(c:C)
WITH bid, collect(distinct c) AS cs
UNWIND cs AS c2
MATCH (c2)-[:T]->(d:D)
WITH d, bid           -- trailing WITH narrowing
RETURN bid, d.id AS id

Currently rejected at compile time by _active_match_alias_for_stage (graphistry/compute/gfql/cypher/lowering.py ~line 2346) because the #1248 prefix-rewriter transforms bid references into <reentry_alias>.__cypher_reentry_bid__ and the per-stage scanner sees both the carry-rewritten root and the trailing-MATCH alias as referenced.

Findings

Lifting only the compile-time guard (filtering <alias>.<__cypher_reentry_*> refs in _expr_match_alias_usage via _is_hidden_reentry_property at lowering.py:2772) admits the query but runtime returns bid=None instead of bid='b'.

Fix surface

_lower_match_alias_stage / _lower_row_column_stage around lowering.py:9685+.

Acceptance

  1. Existing failfasts near test_lowering.py:8953,8972 become positive assertions with concrete values.
  2. Compile-time hidden-reentry-property filter lift composes with runtime fix.
  3. TCK + DGX-Spark RAPIDS 25.02 + 26.02 receipts.
  4. Composes with Cypher: WITH before MATCH re-entry restricts projection to single whole-row alias (blocks IC1) #1071, feat(cypher): ReentryPlan + multi-whole-row prefix WITH (#989 slices 4.1+4.3a) #1248, feat(cypher): forward secondary whole-row carry through chained reentry (#1256) #1258.

Related

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