Skip to content

Direct Cypher row lowering rejects scalar multi-alias projections from a single MATCH #981

@lmeyerov

Description

@lmeyerov

Summary

Direct Cypher currently rejects scalar projections that need values from more than one alias in the matched pattern, even when the final projection only returns scalars.

This showed up immediately while trying to map the first LDBC SNB Interactive reads into pyg-bench.

Environment used for repro:

  • repo: graphistry/pygraphistry
  • sha: ebe7d0ae827d724a8779e123c3965ec723581015
  • host runtime: uv run python ...

Minimal repro

import pandas as pd
from graphistry.tests.test_compute import CGFull

g = CGFull().nodes(
    pd.DataFrame({
        'id': ['a', 'b'],
        'label__A': [True, False],
        'label__B': [False, True],
    }),
    'id',
).edges(
    pd.DataFrame({
        's': ['a'],
        'd': ['b'],
        'type': ['R'],
    }),
    's',
    'd',
)

queries = [
    "MATCH (a:A)-[:R]->(b:B) RETURN a.id AS a_id, b.id AS b_id",
    "MATCH (a:A)-[:R]->(b:B) WITH a.id AS a_id, b.id AS b_id RETURN a_id, b_id",
]

for query in queries:
    print(query)
    print(g.gfql(query)._nodes)

Observed behavior

Both queries fail with:

GFQLValidationError [unsupported-cypher-query] Cypher row lowering currently supports one MATCH source alias at a time | field: return | value: ['a', 'b']

Expected behavior

These should return a single row with both scalar values:

[{'a_id': 'a', 'b_id': 'b'}]

Why this matters

This blocks straightforward scalarized projections for official benchmark queries, for example:

  • SNB IS1: person fields plus p.id AS cityId
  • SNB IS3: friend fields plus r.creationDate AS friendshipCreationDate

Likely relation

This may share an underlying fix with #880, but this is the narrower direct-Cypher user-visible failure mode that is easy to reproduce.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions