8000 post-1.0: add lag/lead window functions · Issue #182 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

post-1.0: add lag/lead window functions #182

Closed

Description

@adityamukho

Roadmap source

ROADMAP.md: Phase 7.7a notes lag / lead were deferred to the post-1.0 backlog.

Work item

Add lag and lead support to Datalog window functions.

Acceptance criteria

  • Parse lag and lead window expressions.
  • Evaluate previous/next row values within each partition and ordering.
  • Define behavior at partition boundaries.
  • Add integration tests for partitioned and unpartitioned queries.
  • Update Datalog docs and examples.

Activity

  1. added
    enhancementNew feature or request
    rustPull requests that update rust code
    on May 1, 2026
  2. added this to the 2.0 milestone on May 17, 2026
  3. modified the milestones: v3.0.0, v3.1.0 on Sep 26, 2026
  4. modified the milestones: v3.1.0, v3.0.0 on Oct 9, 2026
  5. modified the milestones: v3.0.0, v3.1.0 on Oct 20, 2026
  6. adityamukho commented on Oct 20, 2026

    @adityamukho
    CollaboratorAuthor

    Moved to v3.1.0 (as ROADMAP/CLAUDE.md already list it), to be built after #551 so it exists only on the streaming engine, not on the executor that #551 deletes.

    Depends on #547 (spec docs/superpowers/specs/2026-10-20-aggregate-window-engine-design.md, merged in #640):

    • a window sorts each partition by its :order-by value under one total value order (value_order, spec §3.1), then by the other :find-named variables, then input position (§4.1). Rows that tie on all of these are indistinguishable in the output, so row-based results are the same on every plan;
    • without a frame clause, running aggregates use SQL peer semantics (§4.2): every row tied on :order-by gets the value at the last peer;
    • Window holds its whole sorted input (§6), so the work here is per-row evaluation only.

    For lag/lead: the previous/next row is taken in that total order, within the partition; the partition boundary behaviour (default value or nil) still needs defining.

  7. modified the milestones: v3.next, v3.0.0 on Oct 26, 2026
  8. added a commit that references this issue on Oct 26, 2026
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

    enhancementNew feature or requestrustPull requests that update rust code

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0