Repository navigation
index: add prewarm API for named indices - #83
Merged
Merged
Conversation
* expose Table::prewarm_index(name) as lancedb_table_prewarm_index() with the existing status, error message and handle ownership conventions * report LANCEDB_INDEX_NOT_FOUND for a missing index and LANCEDB_INVALID_ARGUMENT for a null or non-UTF-8 name * cover a real BTREE index, a missing name and invalid arguments in the index test entry point Signed-off-by: Xuanwo <[email protected]>
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.
Expose the SDK's
Table::prewarm_index(name)through the C ABI, so a caller built on lancedb-c can load a named index into the cache before the first query.lancedb_table_prewarm_index(table, index_name, error_message)returnsLANCEDB_SUCCESSon success,LANCEDB_INDEX_NOT_FOUNDwhen the table has no index with that name, and the mapped SDK error otherwise; a null or non-UTF-8 name isLANCEDB_INVALID_ARGUMENT. Likelancedb_table_drop_index, the call borrows the table handle and the name, so no ownership crosses the boundary and no existing entry point changes.The operation exists unchanged in the pinned
lancedb0.33 and in0.42.0-beta.21, and both the local (Dataset::prewarm_index) and the remote path reportIndexNotFoundfor an unknown name, so the error mapping holds before and after #78. The change is independent of #74: it only adds a new function, and rich index listing, index statistics and index creation options stay in their own changes.Validation:
cargo check --libpasses on d846623, andtests/test_index.cppcompiles against the new header withg++ -std=c++20 -fsyntax-only. The new sections create a real BTREE index, prewarm it by name, then check that a missing name reportsLANCEDB_INDEX_NOT_FOUNDand that invalid arguments reportLANCEDB_INVALID_ARGUMENT. The regression runs through the existinglancedb_index_testsentry point on hosted CI; there is no local C++ or valgrind run here, because C #51 holds the host's heavy build lease.