You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cypher: labels() function not recognized, silently drops AS alias and subsequent RETURN items #240
The standard Cypher labels(n) function is not recognized, and the failure mode is silent data corruption: it causes the column AS alias to be dropped and subsequent RETURN items to be silently truncated from the result. Two separate symptoms from one root cause.
Minimal reproducer
MATCH (n) WHEREn.file_pathCONTAINS'JarvisApp.swift'RETURNn.nameASname, labels(n) ASlbl, n.labelASlbl_propLIMIT5
Expected: three columns name, lbl, lbl_prop, with lbl being a list of label strings like ["Class"].
Actual: two columns name, labels — the AS lbl alias is ignored (column is named labels after the function), lbl values come back as empty strings, and the entire third RETURN item (n.label AS lbl_prop) is silently dropped from the result even though it's unrelated to labels().
labels() function silently returns empty strings (not an error)
AS alias is ignored for the labels() item — column name becomes labels instead of the alias
Any subsequent RETURN items after a labels() item are dropped entirely from the result
Root cause (hypothesized)
There is no TOK_LABELS in the cbm_token_type_t enum in src/cypher/cypher.h. labels is being tokenized as a regular identifier. The parser then fails on labels(n) at some point in parse_return_item (line 1138) and either returns an error silently or corrupts the return_clause->items array truncating everything after the failing item.
Proposed fix
Add TOK_LABELS to the enum, add "labels" to keyword_lookup, handle it in parse_return_item as a node-accessor function (similar to how toLower/toUpper/toString are handled), and implement the executor to return a list of the node's labels from node->label or the underlying store. Medium fix.
Alternatively, at minimum: make the parser fail loudly on unknown functions instead of silently dropping items. That prevents the silent-data-corruption failure mode regardless of whether labels() is supported.
Verified working on current main — added a regression test that executes labels(n) with an AS alias against an in-memory store and asserts the expected result/columns (passes in the full suite). Closing as resolved; please reopen with a concrete failing query if you still hit this on v0.7.0. 🙏
Activity
DeusData commentedon May 31, 2026
Verified working on current
main— added a regression test that executeslabels(n) with an AS aliasagainst an in-memory store and asserts the expected result/columns (passes in the full suite). Closing as resolved; please reopen with a concrete failing query if you still hit this on v0.7.0. 🙏test(cypher): regression guards for DeusData#240/DeusData#237/DeusDat…