Skip to content

fix(gfql): preserve quoted ORDER BY aliases - #2208

Merged
lmeyerov merged 1 commit into
masterfrom
worker/fix-orderby-quoted-alias
Oct 21, 2026
Merged

lmeyerov merged 1 commit into
masterfrom
worker/fix-orderby-quoted-alias

Conversation

@lmeyerov

@lmeyerov lmeyerov commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Preserve decoded quoted aliases when lowering ORDER BY keys, including aggregate outputs.
  • Preserve binding-kind and quotedness recursively in the shared output-name AST rewriter.
  • Resolve a projected Identifier before aggregate-expression text mapping at both whole-key and nested boundaries.
  • Prepare ORDER BY expressions through the established row-expression boundary so parameters and structured validation remain intact.
  • Keep prior-stage outputs needed only for ORDER BY alive through final RETURN projection.

Boundary Matrix

  • Positive: quoted aliases with spaces, escaped backticks, aggregate groups, expression-like aliases versus real arithmetic, hidden plain/computed WITH keys, null/tie/LIMIT, and empty results.
  • Repaired semantic siblings: literal (a.num + 1) output alias preserves arithmetic semantics for direct RETURN and explicit WITH re-aliasing; compound ORDER BY forms (+1, unary minus, abs, and genuine count(*) + 1) preserve count/sum output bindings.
  • R11 interaction: whole and compound v / `v` resolve to the projected v output, not unrelated aggregate-expression text; genuine sum(w) and explicit group_value controls retain independent ordering.
  • R12 interaction: ORDER BY \alias` * $factoraccepts supplied parameters and keeps opposite-ranking controls correct; missing parameters retain structuredmissing-required-field context (field=order_by, value=factor`).
  • Negative: unresolved quoted aliases report structured invalid-name-type context; genuine unprojected aggregates remain rejected across the row-column and MATCH+UNWIND paths.
  • P0051 caller generalization: four swapped count/sum alias-oracle positives per engine for each UNWIND caller, plus two structured negatives per engine, with opposite independent order controls.
  • Engines: pandas/Polars focused matrix; exact-source cuDF compound, direct, hidden-key, mixed-expression, R11 shadowed-aggregate, and R12 parameter siblings.

Evidence

  • Rebased onto merged fix: preserve igraph collision attributes across round trips #2207 master bf2edb29822fad6b31f482c7203087325c92c7a1. The squashed rebase keeps the lowering.py, backtick tests, and CI-timeout blobs byte-identical; CHANGELOG.md differs only because master now contains the fix: preserve igraph collision attributes across round trips #2207 entry.
  • Exact repaired head: ce0979f48fb66005f1539b3b06878b3543d0ef8a; tree df1286436ebdf8d77df7e430c6c0ea5108e32f6f. It includes accepted R10/R6 from db44b245…, R11 from aa3a49a7…, accepted R12 at 5275db6a…, and the P0051 test-only caller amendment.
  • Exact wave-9 parameter gate from the repaired source: 12/12 passed, exit 0.
  • Exact wave-8 group/sum alias gate from the repaired source: 12/12 passed, exit 0.
  • Exact wave-7 composed swapped-alias regression gate from the repaired source: 24/24 passed, exit 0.
  • Host focused backtick suite at the repaired head: 207 passed, 13 deselected (CUDA-only cases run separately); the added caller matrix is 20/20; Ruff clean; git diff --check clean.
  • Exact-source DGX cuDF proof (graphistry/test-rapids-official:26.02-gfql, cuDF 26.02.01): both new-caller cuDF nodes pass (2 passed, zero skips), and the full backtick suite is 220 passed. Whole-tree archive SHA-256: 9494c7326c6acc960055abc0b6a597c05ae0f2f4d4dffe198d3baf630ae81415. Receipt: worker/research/round-003/S7-2208-rebase-ce0979f48.md.
  • Exact-head CI run 39546451858 is terminal SUCCESS. RTD 35287722 is SUCCESS for this head. It includes TCK, all routes-off lanes, route manifest, and test-polars (3.12) checks. The superseded 86ad494d CI run 39502035223 remains historical green evidence.
  • R10/R6 repaired-source evidence at db44b245… remains accepted: wave-7 24/24, host 163 passed/7 deselected, DGX full backtick suite 170 passed, CI run 39454366281, and RTD build 35274857.
  • R12 receipt: worker/research/round-002/S7-2205-r12-repair-5275db6a.md; prior R11/R10 receipts remain linked in the plan.

Closes #2205

@lmeyerov
lmeyerov force-pushed the worker/fix-orderby-quoted-alias branch 3 times, most recently from d3fbb51 to 5922f0a Compare October 20, 2026 22:50
@lmeyerov
lmeyerov force-pushed the worker/fix-orderby-quoted-alias branch from 5922f0a to ce0979f Compare October 21, 2026 04:52
@lmeyerov
lmeyerov merged commit 5e533f6 into master Oct 21, 2026
95 checks passed
@lmeyerov
lmeyerov deleted the worker/fix-orderby-quoted-alias branch October 21, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GFQL Cypher: ORDER BY a backtick alias containing a space fails order_by validation

1 participant