Fix Lance point lookup detection for pushdown filters#17
Open
liaoruoxue wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a follow-up to the existing Lance BTREE point lookup optimization after the Lance integration moved into
daft-lance. The index-driven scan path exists, but it can miss filters carried inPyPushdowns.filters, so DataFrame queries can still fall back to fragment scans instead of letting Lance use the scalar index.This PR:
pushdowns.filtersas the effective filter when no filters were absorbed throughpush_filtersPyPushdowns.filterswith_row_id,with_row_address,with_rowaddr) andinclude_fragment_idso blob / row identity semantics are preservedTesting
uv run ruff format --check daft_lance testsuv run ruff check daft_lance testsuv run pytest tests/io/lancedb/test_lancedb_point_lookup.py tests/io/lancedb/test_lance_blob_v2_read.py::test_take_blobs_single_row tests/io/lancedb/test_lance_blob_v2_read.py::test_take_blobs_non_contiguous_rows -quv run pytest tests/io/lancedb -qNote:
uv run mypy daft_lance/ tests/currently fails on upstreamorigin/mainwith existing errors; this branch does not increase the mypy error count.Manual validation on a large indexed Lance dataset showed an equality lookup using one scan task instead of enumerating all fragments.