Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Ordered window filtered through a LEFT-joined subquery requests its full source

Open
#2,242 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
database

Research direction

Read issue #1909 and trace how ordered windows set requiresFullSource for joined filters, especially the joinedFilterSourceOf path. Compare a collection join with the described single-source subquery join, then add a regression test for the visible-runs example. Done means the subquery join waits on its source as proposed and the relevant tests pass; the issue gives no test file or entry point.

Written by the indexing model from the issue text.

Description

#1909 pages an ordered window whose cross-alias filter goes through exactly one LEFT join to a collection. The same filter through a LEFT join to a subquery that only filters one collection still sets requiresFullSource. An example is the existence check for "has a visible run":

const visibleRuns = new Query()
  .from({ run: runs })
  .where(({ run }) => not(eq(run.userId, 'admin')))
  .select(({ run }) => ({ k: run.seekId }))
  .distinct()

q.from({ seek: seeks })
  .leftJoin({ visible: visibleRuns }, ({ seek, visible }) => eq(seek.id, visible.k))
  .where(({ visible }) => not(isUndefined(visible.k)))
  .orderBy(({ seek }) => seek.updatedAt, 'desc')
  .limit(10)

The subquery is one collection with no joins, limit, offset or grouping. Its rows are lazy-loaded by key into that collection's source, so the joined-filter gate can wait on that source exactly as for a collection join.

Proposal: treat such a subquery join as a joined filter keyed by the subquery's source (joinedFilterSourceOf). Implemented on 0.15.2 with tests; the full suite passes.

Dominant language
TypeScript
Stars
4k
Forks
277
Avg merge
17h 40m
Merged PRs (30d)
223

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TanStack/db

All issues in TanStack/db

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.