mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-27 04:53:59 +00:00
feat: expose the remaining refresh options on the SDKs (#4890)
The server's backfill request takes a row filter, failure limits, per-call timeouts and worker sizing, and SQL exposes all of them through `REFRESH COLUMN ... WHERE ... WITH (...)`, but the typed SDKs could send only batch_size, GPU placement and the retry and error policies. Anyone needing a filtered refresh or a bounded skip policy had to drop to SQL. This adds `where`, `max_failed_fraction`, `max_failed_rows`, `row_timeout_seconds`, `init_timeout_seconds`, `num_workers` and `max_executor_processes_per_worker` to Python, Rust and Node, passed through unchanged. `RefreshColumnOptions` now serializes straight into the request body, so the three SDKs share one producer. Node gets a `RefreshColumnOptions` object, which also carries the options it lacked before. A LanceDB Embedded refresh rejects every option other than batch_size and GPU placement, naming the option.
This commit is contained in:
@@ -1082,7 +1082,7 @@ for await (const batch of table.query()) {
|
||||
### refreshColumn()
|
||||
|
||||
```ts
|
||||
abstract refreshColumn(column): Promise<RefreshColumnResult>
|
||||
abstract refreshColumn(column, options?): Promise<RefreshColumnResult>
|
||||
```
|
||||
|
||||
Fill the rows of a computed column that hold no value yet.
|
||||
@@ -1098,6 +1098,10 @@ Enterprise a refresh runs as a server job, through [Table#refreshColumnAsync](Ta
|
||||
* **column**: `string`
|
||||
The name of the computed column to fill.
|
||||
|
||||
* **options?**: [`RefreshColumnOptions`](../interfaces/RefreshColumnOptions.md)
|
||||
Refresh options, all LanceDB
|
||||
Enterprise only; see [Table#refreshColumnAsync](Table.md#refreshcolumnasync).
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`RefreshColumnResult`](../interfaces/RefreshColumnResult.md)>
|
||||
@@ -1110,7 +1114,7 @@ number of rows filled and the new version number of the table.
|
||||
### refreshColumnAsync()
|
||||
|
||||
```ts
|
||||
abstract refreshColumnAsync(column): Promise<Job>
|
||||
abstract refreshColumnAsync(column, options?): Promise<Job>
|
||||
```
|
||||
|
||||
Like [Table#refreshColumn](Table.md#refreshcolumn), but returns a handle to the refresh
|
||||
@@ -1130,6 +1134,16 @@ LanceDB Enterprise it is the server's backfill job.
|
||||
* **column**: `string`
|
||||
The name of the computed column to fill.
|
||||
|
||||
* **options?**: [`RefreshColumnOptions`](../interfaces/RefreshColumnOptions.md)
|
||||
Refresh options, mirroring the SQL
|
||||
`REFRESH COLUMN ... WHERE ... WITH (...)` form: `where` narrows the rows,
|
||||
`errorPolicy`, `maxFailedFraction`, `maxFailedRows`, `rowTimeoutSeconds`
|
||||
and `initTimeoutSeconds` govern failing rows, and `batchSize`,
|
||||
`gpuClass`, `gpuCount`, `numWorkers` and `maxExecutorProcessesPerWorker`
|
||||
size the workers. All are LanceDB Enterprise only; a LanceDB Embedded
|
||||
refresh rejects every option other than `batchSize`, `gpuClass` and
|
||||
`gpuCount`.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Job`](Job.md)>
|
||||
@@ -1137,7 +1151,12 @@ LanceDB Enterprise it is the server's backfill job.
|
||||
#### Example
|
||||
|
||||
```ts
|
||||
const job = await table.refreshColumnAsync("doubled");
|
||||
const job = await table.refreshColumnAsync("embedding", {
|
||||
where: "published_at > '2026-01-01'",
|
||||
errorPolicy: "skip",
|
||||
maxFailedFraction: 0.01,
|
||||
rowTimeoutSeconds: 30,
|
||||
});
|
||||
await job.wait();
|
||||
console.log(await job.status()); // "finished"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user