mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-26 20:44:00 +00:00
feat(nodejs): expose Function failure recovery APIs (#5209)
TypeScript callers can now inspect and recover Function row failures through the native workflow. `functionErrors()` groups returned failures and can show retained attempt history. `functionErrorRows()` looks up current failed inputs using row IDs and physical row addresses represented as `bigint`. Older deployments can continue to use the existing error listing. `retryFailed()` selects the exact failed rows on the server, with optional error type and job filters. `upgradeColumn()` binds an existing immutable Function version and can recompute failed rows, all eligible rows, or no rows. Callers can quarantine and release failures, explicitly include quarantined rows in a retry, and use `functionProvenance()` to see which Function version produced a recorded value. The native operations reuse the existing Rust workflow v1 capability checks. The Function failures guide includes TypeScript examples for inspecting, retrying, upgrading, and quarantining failures.
This commit is contained in:
+118
-12
@@ -952,41 +952,81 @@ that version; a latest handle retains normal read-freshness behavior.
|
||||
|
||||
***
|
||||
|
||||
### functionErrorRows()
|
||||
|
||||
```ts
|
||||
functionErrorRows(options?): Promise<FunctionFailedRow[]>
|
||||
```
|
||||
|
||||
Read current failing inputs, one result per error record.
|
||||
Requires a complete LanceDB Enterprise workflow version 1 listing with
|
||||
row identities. Throws if a failed row is no longer addressable in the
|
||||
table's read snapshot. For materialized views, see the source identities
|
||||
on each error record returned by [Table#functionErrors](Table.md#functionerrors).
|
||||
|
||||
#### Parameters
|
||||
|
||||
* **options?**: [`FunctionErrorRowsOptions`](../interfaces/FunctionErrorRowsOptions.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`FunctionFailedRow`](../interfaces/FunctionFailedRow.md)[]>
|
||||
|
||||
***
|
||||
|
||||
### functionErrors()
|
||||
|
||||
```ts
|
||||
abstract functionErrors(options?): Promise<FunctionErrors>
|
||||
```
|
||||
|
||||
The per-row errors Function refreshes recorded on this table.
|
||||
List the per-row errors recorded by Function refreshes on this table.
|
||||
|
||||
A refresh running under a skip policy records each row it skipped with
|
||||
the input that failed and the error. This lists those records, newest
|
||||
job first, plus a summary for any fragment whose per-row detail was
|
||||
capped. LanceDB Enterprise only; reading errors needs read
|
||||
access to the table, since a message carries the value that failed.
|
||||
On LanceDB Enterprise with workflow version 1 or later, the default
|
||||
lists current failures. Set `history: true` to include retained attempts
|
||||
for repaired rows. Older deployments keep their existing default listing.
|
||||
Reading errors requires table read access because messages can include the
|
||||
input that failed. `errorGroups` describes the returned records.
|
||||
|
||||
#### Parameters
|
||||
|
||||
* **options?**: [`FunctionErrorsOptions`](../interfaces/FunctionErrorsOptions.md)
|
||||
Optional filters: `jobId`,
|
||||
`column`, and `limit` (server default 10000, cap 100000).
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`FunctionErrors`](../interfaces/FunctionErrors.md)>
|
||||
|
||||
The records, the capped fragments,
|
||||
and whether the listing stopped at its limit.
|
||||
|
||||
#### Example
|
||||
|
||||
```ts
|
||||
const { records, truncated } = await table.functionErrors({ column: "embedding" });
|
||||
const errors = await table.functionErrors({ column: "embedding" });
|
||||
console.log(errors.records, errors.errorGroups);
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
### functionProvenance()
|
||||
|
||||
```ts
|
||||
functionProvenance(_column, _options?): Promise<FunctionProvenance>
|
||||
```
|
||||
|
||||
Read the producing Function version and job for each returned value.
|
||||
Check `truncated` before treating the result as a complete listing.
|
||||
Requires LanceDB Enterprise Function failure workflow version 1 or later.
|
||||
|
||||
#### Parameters
|
||||
|
||||
* **\_column**: `string`
|
||||
|
||||
* **\_options?**: [`FunctionProvenanceOptions`](../interfaces/FunctionProvenanceOptions.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`FunctionProvenance`](../interfaces/FunctionProvenance.md)>
|
||||
|
||||
***
|
||||
|
||||
### getRTESpec()
|
||||
|
||||
```ts
|
||||
@@ -1350,6 +1390,28 @@ Prewarm an index in the table.
|
||||
|
||||
***
|
||||
|
||||
### quarantineFailed()
|
||||
|
||||
```ts
|
||||
quarantineFailed(_column, _options?): Promise<number>
|
||||
```
|
||||
|
||||
Quarantine current failures and return the number of affected rows.
|
||||
Set `quarantined: false` to release them for future refreshes.
|
||||
Requires LanceDB Enterprise Function failure workflow version 1 or later.
|
||||
|
||||
#### Parameters
|
||||
|
||||
* **\_column**: `string`
|
||||
|
||||
* **\_options?**: [`FunctionQuarantineOptions`](../interfaces/FunctionQuarantineOptions.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`>
|
||||
|
||||
***
|
||||
|
||||
### query()
|
||||
|
||||
```ts
|
||||
@@ -1560,6 +1622,28 @@ out state and the read_consistency_interval, if any, will apply.
|
||||
|
||||
***
|
||||
|
||||
### retryFailed()
|
||||
|
||||
```ts
|
||||
retryFailed(_column, _options?): Promise<Job<RefreshColumnJobResult>>
|
||||
```
|
||||
|
||||
Start a job to retry exactly the current failures of one Function column.
|
||||
Filters apply on the server. Quarantined rows are excluded by default.
|
||||
Requires LanceDB Enterprise Function failure workflow version 1 or later.
|
||||
|
||||
#### Parameters
|
||||
|
||||
* **\_column**: `string`
|
||||
|
||||
* **\_options?**: [`RetryFailedOptions`](../interfaces/RetryFailedOptions.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Job`](Job.md)<[`RefreshColumnJobResult`](../interfaces/RefreshColumnJobResult.md)>>
|
||||
|
||||
***
|
||||
|
||||
### schema()
|
||||
|
||||
```ts
|
||||
@@ -1932,6 +2016,28 @@ await table.updateTableOverrides({
|
||||
|
||||
***
|
||||
|
||||
### upgradeColumn()
|
||||
|
||||
```ts
|
||||
upgradeColumn(_column, _options): Promise<Job<RefreshColumnJobResult>>
|
||||
```
|
||||
|
||||
Start an upgrade to an existing immutable Function version and choose
|
||||
which rows to recompute. New and changed inputs use the new version.
|
||||
Requires LanceDB Enterprise Function failure workflow version 1 or later.
|
||||
|
||||
#### Parameters
|
||||
|
||||
* **\_column**: `string`
|
||||
|
||||
* **\_options**: [`UpgradeColumnOptions`](../interfaces/UpgradeColumnOptions.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Job`](Job.md)<[`RefreshColumnJobResult`](../interfaces/RefreshColumnJobResult.md)>>
|
||||
|
||||
***
|
||||
|
||||
### vectorSearch()
|
||||
|
||||
```ts
|
||||
|
||||
Reference in New Issue
Block a user