@lancedb/lancedb 0.42.0-beta.12 → 0.42.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blob.d.ts +11 -0
- package/dist/blob.js +27 -0
- package/dist/index.d.ts +2 -2
- package/dist/merge.d.ts +17 -0
- package/dist/merge.js +7 -1
- package/dist/native.d.ts +73 -2
- package/dist/native.js +52 -52
- package/dist/query.d.ts +4 -2
- package/dist/query.js +50 -4
- package/dist/table.d.ts +36 -3
- package/dist/table.js +17 -1
- package/package.json +8 -8
package/dist/blob.d.ts
CHANGED
|
@@ -124,6 +124,8 @@ export declare function blob(name: string, options?: BlobOptions): Field;
|
|
|
124
124
|
* field's storage type.
|
|
125
125
|
*/
|
|
126
126
|
export declare function isBlobField(field: Field): boolean;
|
|
127
|
+
/** @ignore */
|
|
128
|
+
export declare function isBlobDescriptorField(field: Field): boolean;
|
|
127
129
|
/**
|
|
128
130
|
* A lazy handle to blob bytes. Create one with {@link Table.fetchBlobFiles}.
|
|
129
131
|
*
|
|
@@ -179,6 +181,15 @@ export type BlobReadOptions = {
|
|
|
179
181
|
};
|
|
180
182
|
/** @ignore */
|
|
181
183
|
export declare function runWithSignal<T>(signal: AbortSignal | undefined, run: (signal: AbortSignal | undefined) => Promise<T>): Promise<T>;
|
|
184
|
+
/** One row-specific range for {@link Table.fetchBlobRanges}. */
|
|
185
|
+
export type BlobRangeRequest = {
|
|
186
|
+
/** A row ID from a query with row IDs enabled. */
|
|
187
|
+
rowId: bigint | number;
|
|
188
|
+
/** Byte offset from the beginning of the logical blob, as a uint64. */
|
|
189
|
+
offset: bigint;
|
|
190
|
+
/** Number of bytes to read, as a uint64. Zero returns an empty non-null value. */
|
|
191
|
+
length: bigint;
|
|
192
|
+
};
|
|
182
193
|
/** A half-open byte range `[start, end)` for {@link BlobFile.readRanges}. */
|
|
183
194
|
export type BlobRange = {
|
|
184
195
|
start: bigint;
|
package/dist/blob.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.BlobFile = void 0;
|
|
6
6
|
exports.blob = blob;
|
|
7
7
|
exports.isBlobField = isBlobField;
|
|
8
|
+
exports.isBlobDescriptorField = isBlobDescriptorField;
|
|
8
9
|
exports.runWithSignal = runWithSignal;
|
|
9
10
|
exports.normalizeBlobInput = normalizeBlobInput;
|
|
10
11
|
exports.blobToRead = blobToRead;
|
|
@@ -82,6 +83,32 @@ function blob(name, options = {}) {
|
|
|
82
83
|
function isBlobField(field) {
|
|
83
84
|
return field.metadata?.get("ARROW:extension:name") === BLOB_V2_EXTENSION_NAME;
|
|
84
85
|
}
|
|
86
|
+
/** @ignore */
|
|
87
|
+
function isBlobDescriptorField(field) {
|
|
88
|
+
// Native descriptor scans replace the logical extension metadata. Require
|
|
89
|
+
// both the encoding marker and the v2 layout to exclude v1 and plain structs.
|
|
90
|
+
if (field.metadata?.get("lance-encoding:blob") !== "true" ||
|
|
91
|
+
!apache_arrow_1.DataType.isStruct(field.type)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
const children = field.type.children;
|
|
95
|
+
const integers = [
|
|
96
|
+
["kind", 8],
|
|
97
|
+
["position", 64],
|
|
98
|
+
["size", 64],
|
|
99
|
+
["blob_id", 32],
|
|
100
|
+
];
|
|
101
|
+
return (children.length === 5 &&
|
|
102
|
+
integers.every(([name, width], index) => {
|
|
103
|
+
const child = children[index];
|
|
104
|
+
return (child.name === name &&
|
|
105
|
+
apache_arrow_1.DataType.isInt(child.type) &&
|
|
106
|
+
!child.type.isSigned &&
|
|
107
|
+
child.type.bitWidth === width);
|
|
108
|
+
}) &&
|
|
109
|
+
children[4].name === "blob_uri" &&
|
|
110
|
+
apache_arrow_1.DataType.isUtf8(children[4].type));
|
|
111
|
+
}
|
|
85
112
|
/**
|
|
86
113
|
* A lazy handle to blob bytes. Create one with {@link Table.fetchBlobFiles}.
|
|
87
114
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,10 @@ export { MaterializedView, MaterializedViewDefinition, MaterializedViewSelect, }
|
|
|
7
7
|
export { ViewDescription } from "./view";
|
|
8
8
|
export { JsHeaderProvider as NativeJsHeaderProvider } from "./native.js";
|
|
9
9
|
export { instrumentLanceDbMetrics } from "./otel";
|
|
10
|
-
export { AddColumnsSql, ConnectionOptions, ConnectNamespaceOptions, IndexStatistics, IndexConfig, ClientConfig, TimeoutConfig, RetryConfig, TlsConfig, OptimizeStats, CompactionStats, RemovalStats, TableStatistics, FragmentStatistics, FragmentSummaryStats, Tags, TagContents, BranchContents, MergeResult, AddResult, AddColumnsResult, RefreshColumnOptions, FunctionWorkerResourceBudget, RefreshColumnResult, FunctionErrors, FunctionErrorsOptions, FunctionErrorRecord, FunctionErrorFragment, RefreshMaterializedViewResult, AlterColumnsResult, UpdateFieldMetadataResult, DeleteResult, DropColumnsResult, UpdateResult, SplitCalculatedOptions, SplitRandomOptions, SplitHashOptions, SplitSequentialOptions, ShuffleOptions, OAuthConfig as NativeOAuthConfig, } from "./native.js";
|
|
10
|
+
export { AddColumnsSql, ConnectionOptions, ConnectNamespaceOptions, IndexStatistics, IndexConfig, ClientConfig, TimeoutConfig, RetryConfig, TlsConfig, OptimizeStats, CompactionStats, RemovalStats, TableStatistics, FragmentStatistics, FragmentSummaryStats, Tags, TagContents, BranchContents, MergeResult, AddResult, AddColumnsResult, RefreshColumnOptions, FunctionRefreshPlanningConfig, FunctionRefreshPodResources, FunctionRetryPolicy, FunctionWorkerResourceBudget, RefreshColumnResult, FunctionErrors, FunctionErrorsOptions, FunctionErrorRecord, FunctionErrorFragment, RefreshMaterializedViewResult, AlterColumnsResult, UpdateFieldMetadataResult, DeleteResult, DropColumnsResult, UpdateResult, SplitCalculatedOptions, SplitRandomOptions, SplitHashOptions, SplitSequentialOptions, ShuffleOptions, OAuthConfig as NativeOAuthConfig, } from "./native.js";
|
|
11
11
|
export { makeArrowTable, makeJsonField, MakeArrowTableOptions, Data, VectorColumnOptions, } from "./arrow";
|
|
12
12
|
export { blob, isBlobField, BlobFile } from "./blob";
|
|
13
|
-
export type { BlobData, BlobInput, BlobOptions, BlobRange, BlobReadOptions, BlobUri, } from "./blob";
|
|
13
|
+
export type { BlobData, BlobInput, BlobOptions, BlobRange, BlobRangeRequest, BlobReadOptions, BlobUri, } from "./blob";
|
|
14
14
|
export { Connection, CreateTableOptions, TableNamesOptions, OpenTableOptions, CreateNamespaceOptions, DropNamespaceOptions, CreateNamespaceResponse, DropNamespaceResponse, DescribeNamespaceResponse, RenameTableOptions, } from "./connection";
|
|
15
15
|
export { JobFailureInfo, JobInfo, Session } from "./native.js";
|
|
16
16
|
export { Job, JobEventsOptions, } from "./job";
|
package/dist/merge.d.ts
CHANGED
|
@@ -99,6 +99,23 @@ export interface WriteExecutionOptions {
|
|
|
99
99
|
* first attempt will not be cancelled.
|
|
100
100
|
*
|
|
101
101
|
* When this is set, the timeout is enforced on all attempts, including the first.
|
|
102
|
+
* For remote tables this is sent as a server execution timeout. It does not
|
|
103
|
+
* extend HTTP read or proxy idle timeouts, or prove that a failed request did
|
|
104
|
+
* not commit.
|
|
102
105
|
*/
|
|
103
106
|
timeoutMs?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Override the remote retry budget for this execution only (an integer from
|
|
109
|
+
* 0 to 255). Use `execute(data, { retries: 0 })` to disable even retries after
|
|
110
|
+
* precommit conflicts (409) or rate limits (429). This does not change
|
|
111
|
+
* connection-wide/read budgets or local transaction conflict retries.
|
|
112
|
+
*
|
|
113
|
+
* By default, remote calls use the connection's `clientConfig.retryConfig`
|
|
114
|
+
* ({@link RetryConfig}). Its `statuses` (also set through
|
|
115
|
+
* `LANCE_CLIENT_RETRY_STATUSES`) selects candidates within the retry budget;
|
|
116
|
+
* it never permits replay of ambiguous merge outcomes. In particular, 502,
|
|
117
|
+
* ordinary 503, and 504 are never replayed, even if configured. Reconcile table
|
|
118
|
+
* contents before manually repeating a merge whose commit outcome is unknown.
|
|
119
|
+
*/
|
|
120
|
+
retries?: number;
|
|
104
121
|
}
|
package/dist/merge.js
CHANGED
|
@@ -102,6 +102,12 @@ class MergeInsertBuilder {
|
|
|
102
102
|
* @returns {Promise<MergeResult>} the merge result
|
|
103
103
|
*/
|
|
104
104
|
async execute(data, execOptions) {
|
|
105
|
+
if (execOptions?.retries !== undefined &&
|
|
106
|
+
(!Number.isInteger(execOptions.retries) ||
|
|
107
|
+
execOptions.retries < 0 ||
|
|
108
|
+
execOptions.retries > 255)) {
|
|
109
|
+
throw new Error("retries must be an integer between 0 and 255");
|
|
110
|
+
}
|
|
105
111
|
let schema;
|
|
106
112
|
if (this.#schema instanceof Promise) {
|
|
107
113
|
schema = await this.#schema;
|
|
@@ -114,7 +120,7 @@ class MergeInsertBuilder {
|
|
|
114
120
|
this.#native.setTimeout(execOptions.timeoutMs);
|
|
115
121
|
}
|
|
116
122
|
const buffer = await (0, arrow_1.fromDataToBuffer)(data, undefined, schema);
|
|
117
|
-
return await this.#native.execute(buffer);
|
|
123
|
+
return await this.#native.execute(buffer, execOptions?.retries);
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
126
|
exports.MergeInsertBuilder = MergeInsertBuilder;
|
package/dist/native.d.ts
CHANGED
|
@@ -299,7 +299,7 @@ export declare class NativeMergeInsertBuilder {
|
|
|
299
299
|
useIndex(useIndex: boolean): NativeMergeInsertBuilder
|
|
300
300
|
useRTE(enable: boolean): NativeMergeInsertBuilder
|
|
301
301
|
validateSingleShard(validateSingleShard: boolean): NativeMergeInsertBuilder
|
|
302
|
-
execute(buf: Buffer): Promise<MergeResult>
|
|
302
|
+
execute(buf: Buffer, retries?: number | undefined | null): Promise<MergeResult>
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
/**
|
|
@@ -439,7 +439,7 @@ export declare class Table {
|
|
|
439
439
|
close(): void
|
|
440
440
|
/** Return Schema as empty Arrow IPC file. */
|
|
441
441
|
schema(): Promise<Buffer>
|
|
442
|
-
add(buf: Buffer, mode: string, progressCallback?: (progress: WriteProgressInfo) => void, allowExternalBlobOutsideBases?: boolean): Promise<AddResult>
|
|
442
|
+
add(buf: Buffer, mode: string, progressCallback?: (progress: WriteProgressInfo) => void, allowExternalBlobOutsideBases?: boolean, retries?: number): Promise<AddResult>
|
|
443
443
|
countRows(filter?: string | undefined | null): Promise<number>
|
|
444
444
|
delete(predicate: string): Promise<DeleteResult>
|
|
445
445
|
createIndex(index: Index | undefined | null, column: string, replace?: boolean | undefined | null, waitTimeoutS?: number | undefined | null, name?: string | undefined | null, train?: boolean | undefined | null): Promise<void>
|
|
@@ -453,12 +453,17 @@ export declare class Table {
|
|
|
453
453
|
latestStorageOptions(): Promise<Record<string, string> | null>
|
|
454
454
|
update(onlyIf: string | undefined | null, columns: Array<[string, string]>): Promise<UpdateResult>
|
|
455
455
|
query(): Query
|
|
456
|
+
/** Whether this handle reads an in-process dataset. */
|
|
457
|
+
isNative(): boolean
|
|
458
|
+
/** Constrain deferred blob reads by the producing query response. */
|
|
459
|
+
querySnapshotWithIdentity(version: string, identity: string): Promise<Table>
|
|
456
460
|
/** Return a read-only table handle pinned to the current query revision. */
|
|
457
461
|
querySnapshot(): Promise<Table>
|
|
458
462
|
takeOffsets(offsets: Array<number>): TakeQuery
|
|
459
463
|
takeRowIds(rowIds: Array<bigint>): TakeQuery
|
|
460
464
|
blobColumns(): Promise<Array<string>>
|
|
461
465
|
fetchBlobs(column: string, rowIds: Array<bigint>, signal?: AbortSignal | undefined | null): Promise<Array<Buffer | undefined | null>>
|
|
466
|
+
fetchBlobRanges(column: string, requests: Array<BlobRangeRequest>, signal?: AbortSignal | undefined | null): Promise<Array<Buffer | undefined | null>>
|
|
462
467
|
fetchBlobFiles(column: string, rowIds: Array<bigint>, signal?: AbortSignal | undefined | null): Promise<Array<BlobFile | undefined | null>>
|
|
463
468
|
vectorSearch(vector: Float32Array): VectorQuery
|
|
464
469
|
addColumns(transforms: Array<AddColumnsSql>): Promise<AddColumnsResult>
|
|
@@ -588,6 +593,12 @@ export interface BlobRange {
|
|
|
588
593
|
end: bigint
|
|
589
594
|
}
|
|
590
595
|
|
|
596
|
+
export interface BlobRangeRequest {
|
|
597
|
+
rowId: bigint
|
|
598
|
+
offset: bigint
|
|
599
|
+
length: bigint
|
|
600
|
+
}
|
|
601
|
+
|
|
591
602
|
export interface CatalogOptions {
|
|
592
603
|
apiKey?: string
|
|
593
604
|
clientConfig?: ClientConfig
|
|
@@ -961,6 +972,60 @@ export interface FunctionErrorsOptions {
|
|
|
961
972
|
limit?: number
|
|
962
973
|
}
|
|
963
974
|
|
|
975
|
+
/**
|
|
976
|
+
* Resources and sizing policy for the planning fleet of one registered
|
|
977
|
+
* Function refresh.
|
|
978
|
+
*/
|
|
979
|
+
export interface FunctionRefreshPlanningConfig {
|
|
980
|
+
/** CPU, memory, and ephemeral-storage limits for one planning worker. */
|
|
981
|
+
resources: FunctionRefreshPodResources
|
|
982
|
+
/** Maximum number of planning workers. */
|
|
983
|
+
maxWorkers: number
|
|
984
|
+
/** Maximum rows assigned to one planning worker. */
|
|
985
|
+
rowsPerWorker: number
|
|
986
|
+
/** Maximum fragments assigned to one planning worker. */
|
|
987
|
+
fragmentsPerWorker: number
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
/**
|
|
991
|
+
* CPU, memory, and ephemeral-storage limits for one Function refresh
|
|
992
|
+
* control-plane pod.
|
|
993
|
+
*/
|
|
994
|
+
export interface FunctionRefreshPodResources {
|
|
995
|
+
/** CPU limit in millicores; 1000 is one CPU. */
|
|
996
|
+
cpuMillis: number
|
|
997
|
+
/** Memory limit in bytes. */
|
|
998
|
+
memoryBytes: number
|
|
999
|
+
/** Ephemeral storage limit in bytes. */
|
|
1000
|
+
ephemeralStorageBytes: number
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* Overrides retries of failed user-code calls for one refresh. Omitted
|
|
1005
|
+
* fields use the Function refresh defaults.
|
|
1006
|
+
*/
|
|
1007
|
+
export interface FunctionRetryPolicy {
|
|
1008
|
+
/** Total calls, including the first; 1 disables retries, maximum 100. */
|
|
1009
|
+
maxAttempts?: number
|
|
1010
|
+
/** Initial exponential-backoff ceiling, in seconds. */
|
|
1011
|
+
initialBackoffSeconds?: number
|
|
1012
|
+
/** Maximum backoff, in seconds. */
|
|
1013
|
+
maxBackoffSeconds?: number
|
|
1014
|
+
/** Exception class names, preferably qualified. */
|
|
1015
|
+
exceptionTypes?: Array<string>
|
|
1016
|
+
/** Regular expression matched against the exception class and message. */
|
|
1017
|
+
messagePattern?: string
|
|
1018
|
+
/** Structured provider error codes or HTTP status codes. */
|
|
1019
|
+
errorCodes?: Array<string>
|
|
1020
|
+
/**
|
|
1021
|
+
* Match connection/timeouts, HTTP 429/503, SlowDown and
|
|
1022
|
+
* ServiceUnavailable.
|
|
1023
|
+
*/
|
|
1024
|
+
transient?: boolean
|
|
1025
|
+
/** Honor Retry-After within the configured maximum. */
|
|
1026
|
+
honorRetryAfter?: boolean
|
|
1027
|
+
}
|
|
1028
|
+
|
|
964
1029
|
/** Aggregate worker resources for one Enterprise Function refresh. */
|
|
965
1030
|
export interface FunctionWorkerResourceBudget {
|
|
966
1031
|
/** Aggregate CPU budget in millicores; 1000 is one CPU. */
|
|
@@ -1263,8 +1328,14 @@ export interface RefreshColumnOptions {
|
|
|
1263
1328
|
* refresh. `gpuCount` inside the budget defaults to zero.
|
|
1264
1329
|
*/
|
|
1265
1330
|
resourceBudget?: FunctionWorkerResourceBudget
|
|
1331
|
+
/** CPU, memory, and ephemeral-storage limits for the refresh supervisor. */
|
|
1332
|
+
supervisorResources?: FunctionRefreshPodResources
|
|
1333
|
+
/** Resources and sizing for the refresh planning fleet. */
|
|
1334
|
+
planningWorkers?: FunctionRefreshPlanningConfig
|
|
1266
1335
|
/** Positive aggregate GPU budget for Function workers. */
|
|
1267
1336
|
gpuCount?: number
|
|
1337
|
+
/** Override retries of failed user-code calls for this refresh. */
|
|
1338
|
+
retryPolicy?: FunctionRetryPolicy
|
|
1268
1339
|
/**
|
|
1269
1340
|
* `"fail"` (default) stops on a row error; `"skip"` writes null and
|
|
1270
1341
|
* records the error, subject to the failure limits.
|
package/dist/native.js
CHANGED
|
@@ -76,8 +76,8 @@ function requireNative() {
|
|
|
76
76
|
try {
|
|
77
77
|
const binding = require('@lancedb/lancedb-android-arm64');
|
|
78
78
|
const bindingPackageVersion = require('@lancedb/lancedb-android-arm64/package.json').version;
|
|
79
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
80
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
79
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
80
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
81
81
|
}
|
|
82
82
|
return binding;
|
|
83
83
|
}
|
|
@@ -95,8 +95,8 @@ function requireNative() {
|
|
|
95
95
|
try {
|
|
96
96
|
const binding = require('@lancedb/lancedb-android-arm-eabi');
|
|
97
97
|
const bindingPackageVersion = require('@lancedb/lancedb-android-arm-eabi/package.json').version;
|
|
98
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
99
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
98
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
99
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
100
100
|
}
|
|
101
101
|
return binding;
|
|
102
102
|
}
|
|
@@ -120,8 +120,8 @@ function requireNative() {
|
|
|
120
120
|
try {
|
|
121
121
|
const binding = require('@lancedb/lancedb-win32-x64-gnu');
|
|
122
122
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-x64-gnu/package.json').version;
|
|
123
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
124
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
123
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
124
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
125
125
|
}
|
|
126
126
|
return binding;
|
|
127
127
|
}
|
|
@@ -139,8 +139,8 @@ function requireNative() {
|
|
|
139
139
|
try {
|
|
140
140
|
const binding = require('@lancedb/lancedb-win32-x64-msvc');
|
|
141
141
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-x64-msvc/package.json').version;
|
|
142
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
143
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
142
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
143
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
144
144
|
}
|
|
145
145
|
return binding;
|
|
146
146
|
}
|
|
@@ -159,8 +159,8 @@ function requireNative() {
|
|
|
159
159
|
try {
|
|
160
160
|
const binding = require('@lancedb/lancedb-win32-ia32-msvc');
|
|
161
161
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-ia32-msvc/package.json').version;
|
|
162
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
163
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
162
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
163
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
164
164
|
}
|
|
165
165
|
return binding;
|
|
166
166
|
}
|
|
@@ -178,8 +178,8 @@ function requireNative() {
|
|
|
178
178
|
try {
|
|
179
179
|
const binding = require('@lancedb/lancedb-win32-arm64-msvc');
|
|
180
180
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-arm64-msvc/package.json').version;
|
|
181
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
182
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
181
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
182
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
183
183
|
}
|
|
184
184
|
return binding;
|
|
185
185
|
}
|
|
@@ -201,8 +201,8 @@ function requireNative() {
|
|
|
201
201
|
try {
|
|
202
202
|
const binding = require('@lancedb/lancedb-darwin-universal');
|
|
203
203
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-universal/package.json').version;
|
|
204
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
205
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
204
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
205
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
206
206
|
}
|
|
207
207
|
return binding;
|
|
208
208
|
}
|
|
@@ -219,8 +219,8 @@ function requireNative() {
|
|
|
219
219
|
try {
|
|
220
220
|
const binding = require('@lancedb/lancedb-darwin-x64');
|
|
221
221
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-x64/package.json').version;
|
|
222
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
223
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
222
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
223
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
224
224
|
}
|
|
225
225
|
return binding;
|
|
226
226
|
}
|
|
@@ -238,8 +238,8 @@ function requireNative() {
|
|
|
238
238
|
try {
|
|
239
239
|
const binding = require('@lancedb/lancedb-darwin-arm64');
|
|
240
240
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-arm64/package.json').version;
|
|
241
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
242
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
241
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
242
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
243
243
|
}
|
|
244
244
|
return binding;
|
|
245
245
|
}
|
|
@@ -262,8 +262,8 @@ function requireNative() {
|
|
|
262
262
|
try {
|
|
263
263
|
const binding = require('@lancedb/lancedb-freebsd-x64');
|
|
264
264
|
const bindingPackageVersion = require('@lancedb/lancedb-freebsd-x64/package.json').version;
|
|
265
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
266
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
265
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
266
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
267
267
|
}
|
|
268
268
|
return binding;
|
|
269
269
|
}
|
|
@@ -281,8 +281,8 @@ function requireNative() {
|
|
|
281
281
|
try {
|
|
282
282
|
const binding = require('@lancedb/lancedb-freebsd-arm64');
|
|
283
283
|
const bindingPackageVersion = require('@lancedb/lancedb-freebsd-arm64/package.json').version;
|
|
284
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
285
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
284
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
285
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
286
286
|
}
|
|
287
287
|
return binding;
|
|
288
288
|
}
|
|
@@ -306,8 +306,8 @@ function requireNative() {
|
|
|
306
306
|
try {
|
|
307
307
|
const binding = require('@lancedb/lancedb-linux-x64-musl');
|
|
308
308
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-x64-musl/package.json').version;
|
|
309
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
310
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
309
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
310
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
311
311
|
}
|
|
312
312
|
return binding;
|
|
313
313
|
}
|
|
@@ -325,8 +325,8 @@ function requireNative() {
|
|
|
325
325
|
try {
|
|
326
326
|
const binding = require('@lancedb/lancedb-linux-x64-gnu');
|
|
327
327
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-x64-gnu/package.json').version;
|
|
328
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
328
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
329
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
330
330
|
}
|
|
331
331
|
return binding;
|
|
332
332
|
}
|
|
@@ -346,8 +346,8 @@ function requireNative() {
|
|
|
346
346
|
try {
|
|
347
347
|
const binding = require('@lancedb/lancedb-linux-arm64-musl');
|
|
348
348
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm64-musl/package.json').version;
|
|
349
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
350
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
349
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
350
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
351
351
|
}
|
|
352
352
|
return binding;
|
|
353
353
|
}
|
|
@@ -365,8 +365,8 @@ function requireNative() {
|
|
|
365
365
|
try {
|
|
366
366
|
const binding = require('@lancedb/lancedb-linux-arm64-gnu');
|
|
367
367
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm64-gnu/package.json').version;
|
|
368
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
369
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
368
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
369
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
370
370
|
}
|
|
371
371
|
return binding;
|
|
372
372
|
}
|
|
@@ -386,8 +386,8 @@ function requireNative() {
|
|
|
386
386
|
try {
|
|
387
387
|
const binding = require('@lancedb/lancedb-linux-arm-musleabihf');
|
|
388
388
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm-musleabihf/package.json').version;
|
|
389
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
390
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
389
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
390
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
391
391
|
}
|
|
392
392
|
return binding;
|
|
393
393
|
}
|
|
@@ -405,8 +405,8 @@ function requireNative() {
|
|
|
405
405
|
try {
|
|
406
406
|
const binding = require('@lancedb/lancedb-linux-arm-gnueabihf');
|
|
407
407
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm-gnueabihf/package.json').version;
|
|
408
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
409
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
408
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
409
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
410
410
|
}
|
|
411
411
|
return binding;
|
|
412
412
|
}
|
|
@@ -426,8 +426,8 @@ function requireNative() {
|
|
|
426
426
|
try {
|
|
427
427
|
const binding = require('@lancedb/lancedb-linux-loong64-musl');
|
|
428
428
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-loong64-musl/package.json').version;
|
|
429
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
430
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
429
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
430
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
431
431
|
}
|
|
432
432
|
return binding;
|
|
433
433
|
}
|
|
@@ -445,8 +445,8 @@ function requireNative() {
|
|
|
445
445
|
try {
|
|
446
446
|
const binding = require('@lancedb/lancedb-linux-loong64-gnu');
|
|
447
447
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-loong64-gnu/package.json').version;
|
|
448
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
449
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
448
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
449
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
450
450
|
}
|
|
451
451
|
return binding;
|
|
452
452
|
}
|
|
@@ -466,8 +466,8 @@ function requireNative() {
|
|
|
466
466
|
try {
|
|
467
467
|
const binding = require('@lancedb/lancedb-linux-riscv64-musl');
|
|
468
468
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-riscv64-musl/package.json').version;
|
|
469
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
470
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
469
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
470
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
471
471
|
}
|
|
472
472
|
return binding;
|
|
473
473
|
}
|
|
@@ -485,8 +485,8 @@ function requireNative() {
|
|
|
485
485
|
try {
|
|
486
486
|
const binding = require('@lancedb/lancedb-linux-riscv64-gnu');
|
|
487
487
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-riscv64-gnu/package.json').version;
|
|
488
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
489
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
488
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
489
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
490
490
|
}
|
|
491
491
|
return binding;
|
|
492
492
|
}
|
|
@@ -505,8 +505,8 @@ function requireNative() {
|
|
|
505
505
|
try {
|
|
506
506
|
const binding = require('@lancedb/lancedb-linux-ppc64-gnu');
|
|
507
507
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-ppc64-gnu/package.json').version;
|
|
508
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
509
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
508
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
509
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
510
510
|
}
|
|
511
511
|
return binding;
|
|
512
512
|
}
|
|
@@ -524,8 +524,8 @@ function requireNative() {
|
|
|
524
524
|
try {
|
|
525
525
|
const binding = require('@lancedb/lancedb-linux-s390x-gnu');
|
|
526
526
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-s390x-gnu/package.json').version;
|
|
527
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
528
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
527
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
528
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
529
529
|
}
|
|
530
530
|
return binding;
|
|
531
531
|
}
|
|
@@ -548,8 +548,8 @@ function requireNative() {
|
|
|
548
548
|
try {
|
|
549
549
|
const binding = require('@lancedb/lancedb-openharmony-arm64');
|
|
550
550
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-arm64/package.json').version;
|
|
551
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
552
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
551
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
552
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
553
553
|
}
|
|
554
554
|
return binding;
|
|
555
555
|
}
|
|
@@ -567,8 +567,8 @@ function requireNative() {
|
|
|
567
567
|
try {
|
|
568
568
|
const binding = require('@lancedb/lancedb-openharmony-x64');
|
|
569
569
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-x64/package.json').version;
|
|
570
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
571
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
570
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
571
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
572
572
|
}
|
|
573
573
|
return binding;
|
|
574
574
|
}
|
|
@@ -586,8 +586,8 @@ function requireNative() {
|
|
|
586
586
|
try {
|
|
587
587
|
const binding = require('@lancedb/lancedb-openharmony-arm');
|
|
588
588
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-arm/package.json').version;
|
|
589
|
-
if (bindingPackageVersion !== '0.42.0-beta.
|
|
590
|
-
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.
|
|
589
|
+
if (bindingPackageVersion !== '0.42.0-beta.14' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
590
|
+
throw new Error(`Native binding package version mismatch, expected 0.42.0-beta.14 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
591
591
|
}
|
|
592
592
|
return binding;
|
|
593
593
|
}
|
package/dist/query.d.ts
CHANGED
|
@@ -51,8 +51,10 @@ export interface QueryExecutionOptions {
|
|
|
51
51
|
* bytes. Blobs inside lists keep their descriptors. Arbitrary projection
|
|
52
52
|
* expressions are not materialized as bytes.
|
|
53
53
|
*
|
|
54
|
-
* The rows and
|
|
55
|
-
*
|
|
54
|
+
* The rows and bytes come from the same snapshot. Remote queries require
|
|
55
|
+
* authoritative query version and snapshot identity headers, verified again
|
|
56
|
+
* by the blob response. Older servers can still return `"descriptions"`.
|
|
57
|
+
* Local queries retry up to three times if the table changes while they run.
|
|
56
58
|
*
|
|
57
59
|
* @example
|
|
58
60
|
* ```ts
|
package/dist/query.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.RecordBatchIterator = RecordBatchIterator;
|
|
|
7
7
|
exports.createAutoQuery = createAutoQuery;
|
|
8
8
|
exports.instanceOfFullTextQuery = instanceOfFullTextQuery;
|
|
9
9
|
const arrow_1 = require("./arrow");
|
|
10
|
+
const blob_1 = require("./blob");
|
|
10
11
|
const expr_1 = require("./expr");
|
|
11
12
|
const native_1 = require("./native");
|
|
12
13
|
async function* RecordBatchIterator(promisedInner) {
|
|
@@ -76,6 +77,30 @@ async function readBlobBytes(table, sources, snapshot, dropRowId) {
|
|
|
76
77
|
.map((field) => field.name)
|
|
77
78
|
.filter((name) => name !== "_rowid"));
|
|
78
79
|
}
|
|
80
|
+
// Discover descriptors from the executed query, not the live table's cached
|
|
81
|
+
// schema. Projection names are literal aliases; only source paths use dots.
|
|
82
|
+
function projectedBlobSources(schema, projection) {
|
|
83
|
+
const sources = [];
|
|
84
|
+
for (const field of schema.fields) {
|
|
85
|
+
const source = projection?.find(([output]) => output === field.name)?.[1] ?? field.name;
|
|
86
|
+
const visit = (child, path) => {
|
|
87
|
+
if ((0, blob_1.isBlobField)(child) || (0, blob_1.isBlobDescriptorField)(child)) {
|
|
88
|
+
sources.push({
|
|
89
|
+
output: field.name,
|
|
90
|
+
path,
|
|
91
|
+
source: [source, ...path].join("."),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else if (arrow_1.DataType.isStruct(child.type)) {
|
|
95
|
+
for (const nested of child.type.children) {
|
|
96
|
+
visit(nested, [...path, nested.name]);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
visit(field, []);
|
|
101
|
+
}
|
|
102
|
+
return sources;
|
|
103
|
+
}
|
|
79
104
|
function withBinaryColumns(table, replacements) {
|
|
80
105
|
if (replacements.size === 0) {
|
|
81
106
|
return table;
|
|
@@ -291,6 +316,27 @@ class QueryBase {
|
|
|
291
316
|
if (context === undefined) {
|
|
292
317
|
return this.collect(options, false);
|
|
293
318
|
}
|
|
319
|
+
if (!context.table.isNative()) {
|
|
320
|
+
// Request row IDs in the same query so newly added Blob columns can be
|
|
321
|
+
// fetched without rerunning the query against a different snapshot.
|
|
322
|
+
const addRowId = !context.withRowId;
|
|
323
|
+
const table = await this.collect(options, addRowId);
|
|
324
|
+
const sources = projectedBlobSources(table.schema, context.projection);
|
|
325
|
+
if (sources.length === 0) {
|
|
326
|
+
return addRowId
|
|
327
|
+
? table.select(table.schema.fields
|
|
328
|
+
.map((field) => field.name)
|
|
329
|
+
.filter((name) => name !== "_rowid"))
|
|
330
|
+
: table;
|
|
331
|
+
}
|
|
332
|
+
const version = table.schema.metadata.get("lancedb:query_version");
|
|
333
|
+
const identity = table.schema.metadata.get("lancedb:query_snapshot");
|
|
334
|
+
if (version === undefined || identity === undefined) {
|
|
335
|
+
throw new Error('blobMode "bytes" requires a trustworthy query snapshot: missing, invalid, or inconsistent x-lancedb-query-version or x-lancedb-query-snapshot. Upgrade every serving node, or use blobMode "descriptions".');
|
|
336
|
+
}
|
|
337
|
+
const snapshot = await context.table.querySnapshotWithIdentity(version, identity);
|
|
338
|
+
return readBlobBytes(table, sources, snapshot, addRowId);
|
|
339
|
+
}
|
|
294
340
|
for (let attempt = 1;; attempt++) {
|
|
295
341
|
// The snapshot pins the bytes. The query runs on the live table, so an
|
|
296
342
|
// unchanged version afterwards proves it read the snapshot's version.
|
|
@@ -316,10 +362,10 @@ class QueryBase {
|
|
|
316
362
|
for await (const batch of RecordBatchIterator(iterator)) {
|
|
317
363
|
batches.push(batch);
|
|
318
364
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
return new arrow_1.Table(batches);
|
|
365
|
+
// Read metadata from the executed stream, including empty results and
|
|
366
|
+
// query types whose individual batches do not carry the stream metadata.
|
|
367
|
+
const schema = (0, arrow_1.tableFromIPC)((await iterator).schema()).schema;
|
|
368
|
+
return new arrow_1.Table(schema, batches);
|
|
323
369
|
}
|
|
324
370
|
blobBytesContext(mode) {
|
|
325
371
|
if (mode === undefined || mode === "descriptions") {
|
package/dist/table.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Table as ArrowTable, Data, DataType, Field, IntoVector, MultiVector, Schema } from "./arrow";
|
|
2
|
-
import { BlobFile, BlobReadOptions } from "./blob";
|
|
2
|
+
import { BlobFile, BlobRangeRequest, BlobReadOptions } from "./blob";
|
|
3
3
|
import { IndexOptions } from "./indices";
|
|
4
4
|
import { Job } from "./job";
|
|
5
5
|
import { MergeInsertBuilder } from "./merge";
|
|
@@ -75,6 +75,12 @@ export interface AddDataOptions {
|
|
|
75
75
|
* when the blob is read later.
|
|
76
76
|
*/
|
|
77
77
|
allowExternalBlobOutsideBases?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Override the remote retry budget for this call (0 to 255). Zero disables
|
|
80
|
+
* retries, including multipart parts. Ambiguous commits are never replayed.
|
|
81
|
+
* Ignored by LanceDB Embedded.
|
|
82
|
+
*/
|
|
83
|
+
retries?: number;
|
|
78
84
|
}
|
|
79
85
|
export interface UpdateOptions {
|
|
80
86
|
/**
|
|
@@ -544,6 +550,26 @@ export declare abstract class Table {
|
|
|
544
550
|
* memory; use {@link Table.fetchBlobFiles} for large values.
|
|
545
551
|
*/
|
|
546
552
|
abstract fetchBlobs(column: string, rowIds: readonly (bigint | number)[], options?: BlobReadOptions): Promise<(Buffer | null)[]>;
|
|
553
|
+
/**
|
|
554
|
+
* Materializes row-specific byte ranges at the table's current checkout.
|
|
555
|
+
* Preserves request order, duplicates, and nulls. Zero length returns an empty
|
|
556
|
+
* buffer for a non-null blob. Invalid ranges or missing rows reject the entire
|
|
557
|
+
* call. See {@link Table.fetchBlobs} for row-ID validity across versions.
|
|
558
|
+
*
|
|
559
|
+
* Remote tables use the batched endpoint when the server advertises support,
|
|
560
|
+
* splitting at 1024 ranges and 64 MiB, including individual larger ranges.
|
|
561
|
+
* Older servers use descriptor queries and BlobFile range reads. Both protocols
|
|
562
|
+
* use one exact branch and version. Errors from an advertised endpoint propagate
|
|
563
|
+
* without switching protocols. All output bytes occupy memory.
|
|
564
|
+
*
|
|
565
|
+
* @example
|
|
566
|
+
* ```ts
|
|
567
|
+
* const bytes = await table.fetchBlobRanges("image", [
|
|
568
|
+
* { rowId: 10n, offset: 0n, length: 1024n },
|
|
569
|
+
* ]);
|
|
570
|
+
* ```
|
|
571
|
+
*/
|
|
572
|
+
abstract fetchBlobRanges(column: string, requests: readonly BlobRangeRequest[], options?: BlobReadOptions): Promise<(Buffer | null)[]>;
|
|
547
573
|
/**
|
|
548
574
|
* Opens lazy blob handles for `column` at the given row IDs using the
|
|
549
575
|
* table's current checkout.
|
|
@@ -643,12 +669,18 @@ export declare abstract class Table {
|
|
|
643
669
|
* `REFRESH COLUMN ... WHERE ... WITH (...)` form: `where` narrows the rows,
|
|
644
670
|
* `errorPolicy`, `maxFailedFraction`, `maxFailedRows`, `rowTimeoutSeconds`
|
|
645
671
|
* and `initTimeoutSeconds` govern failing rows. `batchSize`, `gpuClass`,
|
|
646
|
-
* `maxConcurrency`, `resourceBudget`
|
|
647
|
-
* `maxExecutorProcessesPerWorker` size registered
|
|
672
|
+
* `maxConcurrency`, `resourceBudget`, `supervisorResources`,
|
|
673
|
+
* `planningWorkers` and `maxExecutorProcessesPerWorker` size registered
|
|
674
|
+
* Function refreshes. `retryPolicy` overrides user-code retries only when
|
|
675
|
+
* repeating partial work is safe; set `maxAttempts: 1` to disable retries.
|
|
648
676
|
* `maxConcurrency` overrides the registered default for this logical
|
|
649
677
|
* execution only and is a positive integer; it is not an account-wide
|
|
650
678
|
* quota. A `resourceBudget` requires `cpuMillis` and
|
|
651
679
|
* `memoryBytes`; its `gpuCount` defaults to zero for a CPU-only Function.
|
|
680
|
+
* `supervisorResources` and each `planningWorkers.resources` entry require
|
|
681
|
+
* positive `cpuMillis`, `memoryBytes` and `ephemeralStorageBytes`.
|
|
682
|
+
* `planningWorkers` also requires positive `maxWorkers`,
|
|
683
|
+
* `rowsPerWorker` and `fragmentsPerWorker`.
|
|
652
684
|
* The budget applies only to this explicit refresh and does not configure
|
|
653
685
|
* a later automatic refresh.
|
|
654
686
|
* `gpuCount` at the top level is the shorthand that preserves the
|
|
@@ -1110,6 +1142,7 @@ export declare class LocalTable extends Table {
|
|
|
1110
1142
|
takeRowIds(rowIds: readonly (bigint | number)[]): TakeQuery;
|
|
1111
1143
|
blobColumns(): Promise<string[]>;
|
|
1112
1144
|
fetchBlobs(column: string, rowIds: readonly (bigint | number)[], options?: BlobReadOptions): Promise<(Buffer | null)[]>;
|
|
1145
|
+
fetchBlobRanges(column: string, requests: readonly BlobRangeRequest[], options?: BlobReadOptions): Promise<(Buffer | null)[]>;
|
|
1113
1146
|
fetchBlobFiles(column: string, rowIds: readonly (bigint | number)[], options?: BlobReadOptions): Promise<(BlobFile | null)[]>;
|
|
1114
1147
|
query(): Query;
|
|
1115
1148
|
search(query: string | IntoVector | MultiVector | FullTextQuery, queryType?: string, ftsColumns?: string | string[]): VectorQuery | Query | AutoQuery;
|
package/dist/table.js
CHANGED
|
@@ -67,6 +67,12 @@ class LocalTable extends Table {
|
|
|
67
67
|
return tbl.schema;
|
|
68
68
|
}
|
|
69
69
|
async add(data, options) {
|
|
70
|
+
if (options?.retries !== undefined &&
|
|
71
|
+
(!Number.isInteger(options.retries) ||
|
|
72
|
+
options.retries < 0 ||
|
|
73
|
+
options.retries > 255)) {
|
|
74
|
+
throw new Error("retries must be an integer between 0 and 255");
|
|
75
|
+
}
|
|
70
76
|
const mode = options?.mode ?? "append";
|
|
71
77
|
const schema = await this.schema();
|
|
72
78
|
const buffer = await (0, arrow_1.fromDataToBuffer)(data, undefined, schema);
|
|
@@ -84,7 +90,7 @@ class LocalTable extends Table {
|
|
|
84
90
|
}
|
|
85
91
|
}
|
|
86
92
|
: undefined;
|
|
87
|
-
return await this.inner.add(buffer, mode, progress, options?.allowExternalBlobOutsideBases);
|
|
93
|
+
return await this.inner.add(buffer, mode, progress, options?.allowExternalBlobOutsideBases, options?.retries);
|
|
88
94
|
}
|
|
89
95
|
async update(optsOrUpdates, options) {
|
|
90
96
|
const isValues = "values" in optsOrUpdates && typeof optsOrUpdates.values !== "string";
|
|
@@ -180,6 +186,16 @@ class LocalTable extends Table {
|
|
|
180
186
|
// N-API Option maps missing values to undefined. Collapse those to null.
|
|
181
187
|
return values.map((value) => value ?? null);
|
|
182
188
|
}
|
|
189
|
+
async fetchBlobRanges(column, requests, options) {
|
|
190
|
+
const rowIds = rowIdsToBigInts(requests.map((request) => request.rowId));
|
|
191
|
+
const ranges = requests.map((request, i) => ({
|
|
192
|
+
rowId: rowIds[i],
|
|
193
|
+
offset: request.offset,
|
|
194
|
+
length: request.length,
|
|
195
|
+
}));
|
|
196
|
+
const values = await (0, blob_1.runWithSignal)(options?.signal, (signal) => this.inner.fetchBlobRanges(column, ranges, signal));
|
|
197
|
+
return values.map((value) => value ?? null);
|
|
198
|
+
}
|
|
183
199
|
async fetchBlobFiles(column, rowIds, options) {
|
|
184
200
|
const files = await (0, blob_1.runWithSignal)(options?.signal, (signal) => this.inner.fetchBlobFiles(column, rowIdsToBigInts(rowIds), signal));
|
|
185
201
|
// N-API Option maps missing values to undefined. Collapse those to null.
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"ann"
|
|
12
12
|
],
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "0.42.0-beta.
|
|
14
|
+
"version": "0.42.0-beta.14",
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": "./dist/index.js",
|
|
@@ -111,13 +111,13 @@
|
|
|
111
111
|
"optionalDependencies": {
|
|
112
112
|
"@huggingface/transformers": "4.3.2",
|
|
113
113
|
"openai": "4.29.2",
|
|
114
|
-
"@lancedb/lancedb-darwin-arm64": "0.42.0-beta.
|
|
115
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.42.0-beta.
|
|
116
|
-
"@lancedb/lancedb-linux-arm64-gnu": "0.42.0-beta.
|
|
117
|
-
"@lancedb/lancedb-linux-x64-musl": "0.42.0-beta.
|
|
118
|
-
"@lancedb/lancedb-linux-arm64-musl": "0.42.0-beta.
|
|
119
|
-
"@lancedb/lancedb-win32-x64-msvc": "0.42.0-beta.
|
|
120
|
-
"@lancedb/lancedb-win32-arm64-msvc": "0.42.0-beta.
|
|
114
|
+
"@lancedb/lancedb-darwin-arm64": "0.42.0-beta.14",
|
|
115
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.42.0-beta.14",
|
|
116
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.42.0-beta.14",
|
|
117
|
+
"@lancedb/lancedb-linux-x64-musl": "0.42.0-beta.14",
|
|
118
|
+
"@lancedb/lancedb-linux-arm64-musl": "0.42.0-beta.14",
|
|
119
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.42.0-beta.14",
|
|
120
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.42.0-beta.14"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
123
|
"@types/node": ">=22",
|