mirror of
https://github.com/lancedb/lancedb.git
synced 2026-12-03 07:45:17 +00:00
fix: honor Enterprise query batch size limits (#5350)
Enterprise queries could return Arrow batches larger than the size explicitly requested by the caller. The SDK now slices oversized batches in the final query stream and keeps server-selected batch sizes when the caller omits the limit or passes zero. The search guide shows how to stream a full table or filtered scan in one query using Python's `search().to_batches()`. It covers older deployments that return buffered Arrow IPC files or enforce a query row cap. A local Enterprise 1.16.0 probe streamed all 131,073 rows from a pinned snapshot in one query, with batches of at most 37 rows and the first batch available before the Arrow end-of-stream marker. The probe ran with Plan Executor enabled and disabled. Related to OSS-3133.
This commit is contained in:
+4
-8
@@ -203,10 +203,8 @@ impl Query {
|
||||
timeout_ms: Option<u32>,
|
||||
with_row_id: Option<bool>,
|
||||
) -> napi::Result<RecordBatchIterator> {
|
||||
let mut execution_opts = QueryExecutionOptions::default();
|
||||
if let Some(max_batch_length) = max_batch_length {
|
||||
execution_opts.max_batch_length = max_batch_length;
|
||||
}
|
||||
let mut execution_opts =
|
||||
QueryExecutionOptions::default().with_optional_max_batch_length(max_batch_length);
|
||||
if let Some(timeout_ms) = timeout_ms {
|
||||
execution_opts.timeout = Some(std::time::Duration::from_millis(timeout_ms as u64))
|
||||
}
|
||||
@@ -446,10 +444,8 @@ impl VectorQuery {
|
||||
timeout_ms: Option<u32>,
|
||||
with_row_id: Option<bool>,
|
||||
) -> napi::Result<RecordBatchIterator> {
|
||||
let mut execution_opts = QueryExecutionOptions::default();
|
||||
if let Some(max_batch_length) = max_batch_length {
|
||||
execution_opts.max_batch_length = max_batch_length;
|
||||
}
|
||||
let mut execution_opts =
|
||||
QueryExecutionOptions::default().with_optional_max_batch_length(max_batch_length);
|
||||
if let Some(timeout_ms) = timeout_ms {
|
||||
execution_opts.timeout = Some(std::time::Duration::from_millis(timeout_ms as u64))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user