Skip to content

feat(cypher): bind parameters in SKIP and LIMIT - #41

Merged
prrao87 merged 3 commits into
codex/issue-20-containers-curatedfrom
codex/issue-20-pagination-curated
Oct 26, 2026
Merged

prrao87 merged 3 commits into
codex/issue-20-containers-curatedfrom
codex/issue-20-pagination-curated

Conversation

@stugorf

@stugorf stugorf commented Oct 26, 2026

Copy link
Copy Markdown
Member

Problem and change

Relates to #20. SKIP/LIMIT accept nonnegative integral parameters wherever those clauses already exist, including WITH LIMIT. Missing, null, fractional, negative and overflowing values fail explicitly. Row counts that affect plan shape bypass template reuse.

Parser, semantic, Rust execution and Python tests cover valid counts, lexical scope and rejected forms. The Cypher/API guides include executable examples. The Rust README documents the public RowCount AST migration for downstream exhaustive matches; Python method signatures are unchanged.

Validation

Head 90c141a0979bea1291baba501d49677a8dabb516; frozen parent 89f96a422a6a2e566b68496269f63b6f00ef908c. Focused checks and regression details record commands, results, documentation and compatibility. The release receipt pins wheel/archive identity and 455 installed tests.

Both complete workloads pass unchanged goldens in memory and lazy modes. Retained first-pass geometric mean speedups are below (greater than one is faster). Per-query results and paired investigations remain in the audit archive.

Workload/mode Main Actual parent
Q30 memory 0.965 0.984
Q30 lazy 0.946 1.004
IC memory 1.014 1.028
IC lazy 1.008 0.996

Measurements use the same Apple M4 Max (16 cores, 128 GiB), macOS 26.6.2 arm64 and Python 3.13.17, with Q30 revision 6260689 and IC revision c185123. Reproduction instructions pin settings, data checksums, locks and commands. The frozen main baseline is code-identical to current main 90114f3; the equivalence check also verifies clean prospective main-target merges.

Individual review gates pass under the recorded repeat/controlled-investigation rules. Initial failed measurements remain intact in the audit record.

User impact

Existing SKIP/LIMIT positions accept nonnegative integral parameters, including WITH LIMIT. Missing, null, fractional, negative and overflowing values are rejected. Supported-feature tables and executable examples are updated.

Review ledger · Current contribution guide

Audit archive: 47,675,190 bytes; SHA-256 b3486fb30a34639c830b5d49353b3838f96369f95df959ac35f85511f7f8b2de. The small current-main supplement preserves the documentation update. Original absolute paths in receipts map to included records through the archive index.

Submitted by David Hughes (@stugorf), with AI Collaboration.

Resolve literal-or-parameter row counts before logical planning, including chained WITH limits. Reject invalid counts without truncation or wraparound.

Part of #20. Implemented with assistance from Codex; coordinated runtime and benchmark checks pending.
Document literal and parameter RowCount construction for Rust consumers without changing the Python signatures.

Submitted by David Hughes (@stugorf), with AI Collaboration.
@prrao87
prrao87 marked this pull request as ready for review October 26, 2026 16:49
* feat(cypher): add numeric scalar functions

Implement the math-function submission for #20. Reuse DataFusion kernels for abs, floor, ceil, and sqrt; enforce numeric arguments and Cypher rounding ties, nulls, return types, and overflow errors. Document the finite supported signatures with executable examples.

Validation: 343 Rust library tests and Python static checks pass. Exact-source Python runtime checks and workspace clippy are in progress; release evidence is tracked separately.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* test(cypher): cover non-finite Arrow math inputs

Exercise infinity and NaN through Arrow columns while preserving the existing rejection of non-finite parameter values. Document out-of-range unsigned input errors.

Validation: 343 Rust library tests, workspace all-target clippy, 96 focused and 548 total Python tests, Python static checks, strict docs, spelling, and executable documentation pass.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* fix(cypher): guard math SQL export semantics

Reject runtime-only scalar implementations after constant folding instead of exporting same-named SQL functions with different Cypher values or types. Preserve native SQL functions, document NotImplementedError, and test real math SQL comparisons.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* docs(cypher): clarify unsigned math conversion

Limit the Int64 overflow restriction to integer abs. The remaining math functions convert numeric values, including UInt64, to Float64; cover those Arrow inputs with real execution tests.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* fix(cypher): preserve typed nulls in SQL export

Use DataFusion arrow_cast after constant folding so typed nulls retain their Arrow result types. Preserve untyped nulls and reject typed-null export to other dialects. Verify real SQL/Cypher round trips and document the boundary.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* Add Cypher string and list scalar functions (#43)

* feat(cypher): add string and list scalar functions

Implement the separate string/list submission for #20 on the numeric-function prerequisite. Add Unicode string operations, list extraction/reversal, outer list size, stepped ranges, strict argument kinds, and empty quoted literals. Update the unsupported-function regression now that replace is supported.

Validation: Python static checks, formatting, strict docs, and spelling pass. Exact-source Rust and Python runtime checks are pending and tracked separately; old combined-source evidence is preserved.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* fix(cypher): reject unsigned range argument overflow

Return an error when an Arrow UInt64 range endpoint or step exceeds Int64 instead of silently converting it to null. Preserve actual null arguments. Add Rust and CSR/join Python regressions and document the boundary.

* fix(cypher): preserve native list SQL exports

Translate Cypher list size and inclusive range wrappers into faithful native SQL expressions before applying the inherited registry guard. Add string/null and List/LargeList/FixedSizeList SQL coverage and document runtime-only string exports.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* test(cypher): cover null string and list SQL types

Compare real Cypher and SqlEngine results for null string/list functions and typed empty-list extraction, preserving exact Arrow output types after constant folding.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* Add map/entity keys and node labels (#44)

* feat(cypher): add map and entity keys with node labels

Implement keys for maps and exposed entity property columns, preserving
null map fields while omitting absent entity properties. Resolve labels
from canonical configured node bindings and preserve optional nulls and
WITH aliases. Reject mixed-label bindings explicitly.

Validation: 344 Rust library tests, 32 focused Python cases, all 615 Python
tests, workspace all-target clippy, Python lint, executable documentation,
strict docs build, spelling, formatting, and whitespace checks pass.

Part of #20; mixed-label labels() remains an explicit engine boundary.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* Add ordered reduce and list predicates (#45)

* feat(cypher): add ordered reduce and list predicates

Part of #20. Keep fold variables local, preserve list order and null semantics, and correlate graph predicates with iterator bindings. Document supported forms and explicit body limits.

* docs(cypher): explain list fold AST migration

Document the exhaustive-match and local-scope requirements for Rust consumers of the new fold expression variants.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* fix(query): resolve shadowing output aliases in sort (#49)

Resolve all RETURN expressions before applying scalar aliases to the
ORDER BY binding scope. Preserve whole-node projection behavior.

Add focused planner and CSR/join Python regressions for issue #21.
Document alias scope in the Cypher guide.

Validation: Rust formatting, Python lint, strict docs build, spelling,
and whitespace checks pass. Published 0.2.0 reproduction: 14 failures,
4 existing passes. Current-source runtime tests remain pending the
coordinated build.

Implemented by David Hughes with assistance from Codex.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying lance-csr with  Cloudflare Pages  Cloudflare Pages

Latest commit: d85aab2
Status:⚡️  Build in progress...

View logs

@prrao87
prrao87 merged commit 6cb7e7b into codex/issue-20-containers-curated Oct 26, 2026
7 of 8 checks passed
@prrao87
prrao87 deleted the codex/issue-20-pagination-curated branch October 26, 2026 16:52
prrao87 pushed a commit that referenced this pull request Oct 26, 2026
* feat(cypher): support list and map parameters

Preserve integer IDs in nested parameter expressions and round-trip containers through CypherQuery.parameters. Validate keys, integer bounds and nesting; document Arrow list coercion.

Part of #20; based on #3. Implemented with assistance from Codex. Runtime and benchmark validation pending.

* fix(cypher): lower empty maps as empty struct values

DataFusion named_struct requires arguments. Use an empty Struct scalar for empty literal and parameter maps. Covered by the container parameter round-trip regression.

Part of #20. Submitted by David Hughes (@stugorf), with AI Collaboration.

* fix(python): type recursive container parameters and results

Keep the public stubs and strict consumer examples in the container-parameter submission. Accept nested lists and string-keyed dictionaries, retain recursive result typing, and continue rejecting unsupported sets and arbitrary objects.

Validation: make install, all411Python tests, strict Pyright/Ruff, executable docs, strict Zensical and pinned spelling pass. Complete Rust workspace/Clippy verification is running on the unchanged native source.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* feat(cypher): bind parameters in SKIP and LIMIT (#41)

* feat(cypher): bind parameters in skip and limit

Resolve literal-or-parameter row counts before logical planning, including chained WITH limits. Reject invalid counts without truncation or wraparound.

Part of #20. Implemented with assistance from Codex; coordinated runtime and benchmark checks pending.

* docs(cypher): explain the pagination AST migration

Document literal and parameter RowCount construction for Rust consumers without changing the Python signatures.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* Add numeric scalar functions with strict Cypher types (#42)

* feat(cypher): add numeric scalar functions

Implement the math-function submission for #20. Reuse DataFusion kernels for abs, floor, ceil, and sqrt; enforce numeric arguments and Cypher rounding ties, nulls, return types, and overflow errors. Document the finite supported signatures with executable examples.

Validation: 343 Rust library tests and Python static checks pass. Exact-source Python runtime checks and workspace clippy are in progress; release evidence is tracked separately.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* test(cypher): cover non-finite Arrow math inputs

Exercise infinity and NaN through Arrow columns while preserving the existing rejection of non-finite parameter values. Document out-of-range unsigned input errors.

Validation: 343 Rust library tests, workspace all-target clippy, 96 focused and 548 total Python tests, Python static checks, strict docs, spelling, and executable documentation pass.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* fix(cypher): guard math SQL export semantics

Reject runtime-only scalar implementations after constant folding instead of exporting same-named SQL functions with different Cypher values or types. Preserve native SQL functions, document NotImplementedError, and test real math SQL comparisons.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* docs(cypher): clarify unsigned math conversion

Limit the Int64 overflow restriction to integer abs. The remaining math functions convert numeric values, including UInt64, to Float64; cover those Arrow inputs with real execution tests.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* fix(cypher): preserve typed nulls in SQL export

Use DataFusion arrow_cast after constant folding so typed nulls retain their Arrow result types. Preserve untyped nulls and reject typed-null export to other dialects. Verify real SQL/Cypher round trips and document the boundary.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* Add Cypher string and list scalar functions (#43)

* feat(cypher): add string and list scalar functions

Implement the separate string/list submission for #20 on the numeric-function prerequisite. Add Unicode string operations, list extraction/reversal, outer list size, stepped ranges, strict argument kinds, and empty quoted literals. Update the unsupported-function regression now that replace is supported.

Validation: Python static checks, formatting, strict docs, and spelling pass. Exact-source Rust and Python runtime checks are pending and tracked separately; old combined-source evidence is preserved.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* fix(cypher): reject unsigned range argument overflow

Return an error when an Arrow UInt64 range endpoint or step exceeds Int64 instead of silently converting it to null. Preserve actual null arguments. Add Rust and CSR/join Python regressions and document the boundary.

* fix(cypher): preserve native list SQL exports

Translate Cypher list size and inclusive range wrappers into faithful native SQL expressions before applying the inherited registry guard. Add string/null and List/LargeList/FixedSizeList SQL coverage and document runtime-only string exports.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* test(cypher): cover null string and list SQL types

Compare real Cypher and SqlEngine results for null string/list functions and typed empty-list extraction, preserving exact Arrow output types after constant folding.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* Add map/entity keys and node labels (#44)

* feat(cypher): add map and entity keys with node labels

Implement keys for maps and exposed entity property columns, preserving
null map fields while omitting absent entity properties. Resolve labels
from canonical configured node bindings and preserve optional nulls and
WITH aliases. Reject mixed-label bindings explicitly.

Validation: 344 Rust library tests, 32 focused Python cases, all 615 Python
tests, workspace all-target clippy, Python lint, executable documentation,
strict docs build, spelling, formatting, and whitespace checks pass.

Part of #20; mixed-label labels() remains an explicit engine boundary.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* Add ordered reduce and list predicates (#45)

* feat(cypher): add ordered reduce and list predicates

Part of #20. Keep fold variables local, preserve list order and null semantics, and correlate graph predicates with iterator bindings. Document supported forms and explicit body limits.

* docs(cypher): explain list fold AST migration

Document the exhaustive-match and local-scope requirements for Rust consumers of the new fold expression variants.

Submitted by David Hughes (@stugorf), with AI Collaboration.

* fix(query): resolve shadowing output aliases in sort (#49)

Resolve all RETURN expressions before applying scalar aliases to the
ORDER BY binding scope. Preserve whole-node projection behavior.

Add focused planner and CSR/join Python regressions for issue #21.
Document alias scope in the Cypher guide.

Validation: Rust formatting, Python lint, strict docs build, spelling,
and whitespace checks pass. Published 0.2.0 reproduction: 14 failures,
4 existing passes. Current-source runtime tests remain pending the
coordinated build.

Implemented by David Hughes with assistance from Codex.
@prrao87

prrao87 commented Oct 26, 2026

Copy link
Copy Markdown
Member

This change merged into an intermediate branch, not main. It reached main through #55, which brought in the final integrated version of this work with every original commit kept on its branch. Follow-up fixes from review are listed there.

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.

2 participants