8000 feat: add lag and lead window functions (#182) by adityamukho · Pull Request #763 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

feat: add lag and lead window functions (#182) - #763

Merged
adityamukho merged 2 commits into
v3from
feat/182-lag-lead
Oct 26, 2026
Merged

adityamukho merged 2 commits into
v3from
feat/182-lag-lead

Conversation

@adityamukho
@adityamukho adityamukho commented Oct 26, 2026 •
Copy link
Copy Markdown
Collaborator

Problem and result

Window queries could rank and aggregate ordered partitions but could not read a neighboring row. lag and lead now return the preceding or following row's value within a partition, using the existing total order (including tie breaks). They return nil at partition boundaries and operate over grouped rows after aggregation. The plain (lag ?v) and (lead ?v) forms still resolve to registered user aggregates; the built-ins use :over.

This places #182 in v3.0.0, as agreed with the maintainer. PRS-030 remains registered and is documented as deprecated. No storage format, dependency, or public Rust API changes are involved.

Validation

  • cargo test --quiet (1880 tests: 1866 passed, 14 ignored)
  • cargo test --features test-hooks --test plan_independence_test --quiet (16 passed)
  • cargo clippy --all-features -- -D warnings
  • cargo fmt --all --check
  • Docs-site tests and 13-version build pass in the companion PR.

The local release build's increase over untouched origin/v3 was under 1 KiB on the same toolchain; the exact baseline commit passed the CI binary-size gate at 1213 KiB of 1230 KiB. CI on this PR is the authoritative size check. A pre-existing gap in memory accounting for temporary window result columns is tracked in #761.

Companion docs-site PR: project-minigraf/minigraf-docs#74. Merge the core PR first.

Refs #182

@codecov
codecov Bot commented Oct 26, 2026 •
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/query/datalog/aggregate.rs 81.81% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

8000
@adityamukho
adityamukho marked this pull request as ready for review October 26, 2026 08:06
@adityamukho
adityamukho merged commit 246b130 into v3 Oct 26, 2026
19 checks passed
@adityamukho
adityamukho deleted the feat/182-lag-lead branch October 26, 2026 08:07
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.

1 participant

0