Skip to content

query_graph silently returns blank default projection for unsupported WITH expression #373

Closed

Description

@zer09

Summary

query_graph appears to mishandle computed expressions in WITH, especially split(...)[0]. Instead of returning the requested columns or an explicit unsupported-query error, it returns a default-looking projection with blank values.

Repro

MATCH (f:File)
WITH split(f.file_path,'/')[0] AS top, count(*) AS files
RETURN top, files
ORDER BY files DESC

Expected behavior

Either:

  • Valid grouped output with columns top, files; or
  • An explicit error saying the expression/query is unsupported.

Actual behavior

The tool returned:

  • Columns: f.name, f.qualified_name, f.label
  • Total rows: one row per File node, 449 in this case
  • Row values: blank strings, for example ["", "", ""]

This looks like a fallback/default file-node projection rather than the requested return shape.

Control queries that worked

MATCH (f:File) RETURN count(f) AS files

Returned 449.

MATCH (f:File) RETURN f.file_path AS path LIMIT 5

Returned valid paths, for example cloudbuild.yaml, vitest.config.ts, and capacitor.config.ts.

Additional observations

This also returned blank values instead of an error:

MATCH (f:File)
RETURN split(f.file_path,'/')[0] AS top
LIMIT 5

And an obviously unsupported function behaved similarly:

MATCH (f:File)
RETURN foo(f.file_path) AS nope
LIMIT 3

Why this matters

Silent wrong output is worse than a query failure. Callers can mistake blank/default rows for valid graph evidence and make incorrect downstream claims.

Possible cause

One or more of these may be unsupported or mishandled:

  • split()
  • list indexing with [0]
  • computed aliases in WITH
  • aggregation over a computed expression
  • fallback behavior when expression evaluation fails

If these expressions are intentionally unsupported, query_graph should fail closed with a clear error instead of returning blank/default projections.

Sample Output

{
   "project": "home-gc-projcet-directory",
   "query": "MATCH (f:File) WITH split(f.file_path,'/')[0] AS top, count(*) AS files RETURN top, files ORDER BY files DESC"
 }
 {"columns":["f.name","f.qualified_name","f.label"],"rows":[["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",
 ""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""],["","",""]],"total":449}




{
   "project": "home-gc-project-directory",
   "query": "MATCH (n) WHERE n.file_path STARTS WITH 'src/store/' RETURN labels(n)[0] AS label, count(n) AS count ORDER BY count DESC",
   "max_rows": 20
 }
 {"columns":["labels"],"rows":[[""],[""],[""],[""],[""],[""],[""]],"total":7}

Activity

  1. added
    bugSomething isn't working
    cypherCypher query language parser/executor bugs
    on May 30, 2026
  2. DeusData commented on May 31, 2026

    @DeusData
    Owner

    Confirmed reproducible: an unsupported WITH expression (WITH split(f.file_path,'/')[0] AS top, count(*) AS files) does not error — it silently falls back to a default node projection (f.name/f.qualified_name/f.label) with blank values, which is worse than failing. Fix scope: when a projection/WITH expression isn't supported, return an explicit error in the result instead of the silent default. This is the highest-priority of the Cypher set (silent-wrong-output). Reproduced + queued. 🙏

  3. DeusData commented on May 31, 2026

    @DeusData
    Owner

    Fixed in commit a2cd1e7. The root problem was a parser desync: split(f.file_path,'/')[0] parsed split as a bare variable and left (...)[0] unconsumed, which knocked the parser out of alignment and made it fall back to a default star projection — exactly the f.name / f.qualified_name / f.label columns with blank values and one row per node you saw.

    parse_return_item now consumes the balanced parentheses/brackets of an unknown function-call/index expression, so the parser stays in sync. The result: your requested column shape is preserved (top, files — not the misleading star columns), sibling aggregates like count(*) still compute, and the unsupported split(...)[0] term simply projects empty rather than corrupting the whole projection.

    Note: this makes the output honest (correct columns, no misleading blank star projection) but does not yet evaluate split()/list-indexing — so grouping by top collapses to a single blank group. Full split() + list-indexing support is a separate scalar-expression feature; if you need true per-directory grouping, open a focused enhancement and I'll implement the split/index evaluator. Verified by a regression test asserting the requested columns (not the star projection) are returned, with labels()/toInteger() still working. Ships next release — thanks for the precise repro and the clear expected-behavior options!

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

    bugSomething isn't workingcypherCypher query language parser/executor bugs

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions