feat(scan): add lance_namespace_query_table setting to opt out of query_table scans - #235
Open
yichenw wants to merge 1 commit into
Open
feat(scan): add lance_namespace_query_table setting to opt out of query_table scans#235yichenw wants to merge 1 commit into
yichenw wants to merge 1 commit into
Conversation
…ry_table scans REST namespace scans unconditionally use the query_table API since lance-format#232. Namespace servers that implement the describe/list surface but not query_table now fail every scan with a hard error, e.g.: Failed to create Lance namespace query_table stream (Lance error: namespace query_table: Namespace error: ... 404 Not Found ...) Add a lance_namespace_query_table setting (default true, preserving current behaviour). When disabled, REST namespace table scans open the underlying dataset directly via describe_table - the pre-lance-format#232 path, which the search and maintenance flows still use. Table resolution stays on the namespace; reads then require direct storage access. - register the option in LanceExtension::Load - gate the namespace-query branch in LanceTableEntry::GetScanFunction - document the setting in docs/rest.md and docs/sql.md - add test/sql/namespace_rest_scan_direct.test asserting the EXPLAIN scan backend flips between namespace_query_table and dataset
yichenw
marked this pull request as ready for review
August 4, 2026 06:04
Contributor
Author
|
Friendly bump — CI has been green on this for two weeks and it's blocking us from picking up the lance v9 decoder fix (our namespace server doesn't implement query_table, so the current unconditional routing breaks every scan for us). Happy to adjust the approach if you'd prefer an automatic fallback over a setting. |
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.
Problem
Since #232, scans of REST-namespace tables unconditionally go through the Lance Namespace
query_tableAPI. Namespace servers that implement the describe/list surface but notquery_tablenow fail every scan with a hard error:We hit this in production: our self-hosted namespace server implements table resolution (
describe_table) but notquery_table, and the DuckDB engine reads the underlying datasets from object storage directly. After picking up #232 (via the v9 bump in #234), every scan-shaped query against the catalog failed; only metadata-only queries survived.Change
Add a
lance_namespace_query_tablesession setting, defaulttrue(current behaviour unchanged). When set tofalse, REST-namespace table scans skip thequery_tablebranch inLanceTableEntry::GetScanFunctionand open the underlying dataset directly — the pre-#232 path, which the search and maintenance flows still use. Table resolution stays on the namespace; reads then require direct storage access (as documented).LanceExtension::Load(mirrorslance_deferred_materialization)GetScanFunctionon the settingdocs/rest.mdanddocs/sql.mdtest/sql/namespace_rest_scan_direct.test: asserts the EXPLAINLance Scan Backendflips betweennamespace_query_tableanddatasetwith the setting, and that scans work in both modesNotes
query_table, cached per attached namespace — the setting here is the minimal explicit escape hatch.