Skip to content

fix: apply filtered read limit after refine filter#6937

Open
Xuanwo wants to merge 1 commit into
mainfrom
xuanwo/fix-filtered-read-limit-refine
Open

fix: apply filtered read limit after refine filter#6937
Xuanwo wants to merge 1 commit into
mainfrom
xuanwo/fix-filtered-read-limit-refine

Conversation

@Xuanwo
Copy link
Copy Markdown
Collaborator

@Xuanwo Xuanwo commented May 25, 2026

FilteredReadExec could spend a pushed-down LIMIT on scalar-index matches before evaluating a remaining refine filter, which allowed filtered scans to return fewer rows than requested even when enough rows matched the full predicate.

This keeps scalar-index range truncation behind the full-filter exactness boundary: indexed candidates are still narrowed by the scalar index, but scan_range_after_filter is only consumed early when no refine filter remains. Regression coverage exercises both the FilteredReadExec path and the scanner(filter, limit) end-to-end behavior.

Fixes lancedb/lancedb#3436.

@github-actions github-actions Bot added the bug Something isn't working label May 25, 2026
@Xuanwo Xuanwo marked this pull request as ready for review May 25, 2026 14:47
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@Xuanwo Xuanwo marked this pull request as draft May 25, 2026 14:47
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Xuanwo Xuanwo marked this pull request as ready for review May 25, 2026 15:54
@Xuanwo
Copy link
Copy Markdown
Collaborator Author

Xuanwo commented May 25, 2026

@claude review once

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has reached its monthly code review spending cap.

An organization admin can view or raise the cap at claude.ai/admin-settings/claude-code. The cap resets at the start of the next billing period.

Once the cap resets or is raised, comment @claude review on this pull request to trigger a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scanner(filter=A AND B, limit=N)` returns 0 rows when A has a scalar index (BTree or Bitmap) and matches are not in the first fragment

1 participant