Skip to content

Preserve next-page cursor on scan with post-filter - #324

Merged
em3s merged 2 commits into
mainfrom
feat/issue-323-filter-offset
May 14, 2026
Merged

em3s merged 2 commits into
mainfrom
feat/issue-323-filter-offset

Conversation

@em3s

@em3s em3s commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

DataFrame.where() was constructing a new instance and dropping offsets / hasNext / stats, so any scan invoked with a filters (post-filter) argument returned offset: null / hasNext: false, breaking pagination.

offset is a property of the underlying paginated scan, not of the filter mode. A post-filter must be transparent to scan metadata: even if every row on a page is rejected by the filter, the cursor must survive as long as the underlying scan has more rows to read.

Closes #323

Changes

  • DataFrame.where() now returns copy(rows = filteredRows), preserving offsets / hasNext / stats instead of dropping them.
  • Added scan with offset and filters regression test in QueryServiceSpec (not IndexFilterSpec as originally written in the issue — that spec only covers the ranges channel via otherPredicates, not the filters post-filter channel).

How to Test

./gradlew :engine:test --tests "com.kakao.actionbase.v2.engine.v3.QueryServiceSpec"

The regression test paginates with limit=2 + filters=permission:eq:me and verifies that page 1 returns a non-null cursor and that page 2, resuming via that cursor, yields the remaining matching row.

AI Assistance

  • This PR was written largely with AI assistance.
    • Tool / model: claude code (opus 4.7)

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels May 13, 2026
@em3s em3s changed the title 필터 적용 scan의 다음 페이지 커서 보존 fix: preserve next-page cursor on scan with post-filter May 13, 2026
em3s and others added 2 commits May 13, 2026 23:21
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`DataFrame.where()` was constructing a new instance and dropping
`offsets` / `hasNext` / `stats`, so any scan invoked with a `filters`
(post-filter) argument returned `offset: null` / `hasNext: false`,
breaking pagination.

`offset` is a property of the underlying paginated scan, not of the
filter mode. A post-filter must be transparent to scan metadata: even
if every row on a page is rejected by the filter, the cursor must
survive as long as the underlying scan has more rows to read.

Adds a `scan with offset and filters` regression test in
`QueryServiceSpec` that paginates with `limit=2 + filters=permission:eq:me`
and verifies that page 1 returns a usable cursor and page 2 yields the
remaining matching row.

Closes #323

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@em3s
em3s force-pushed the feat/issue-323-filter-offset branch from 281868f to bfb402a Compare May 13, 2026 14:21
@em3s em3s changed the title fix: preserve next-page cursor on scan with post-filter Preserve next-page cursor on scan with post-filter May 14, 2026
@em3s

em3s commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

Optimistic Merging

@em3s
em3s merged commit c0db5d5 into main May 14, 2026
2 checks passed
@em3s
em3s deleted the feat/issue-323-filter-offset branch May 14, 2026 01:00
@em3s em3s self-assigned this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scan with filters drops next-page cursor

1 participant