@lancedb/lancedb 0.42.0-beta.19 → 0.42.0-beta.20

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.
@@ -0,0 +1,23 @@
1
+ /** Actual committed outcome of one remote compaction job. */
2
+ export interface CompactionResult {
3
+ /** A bounded run left eligible work for another invocation. */
4
+ moreWork: boolean;
5
+ /** Some planned groups were not committed. */
6
+ partialCommit: boolean;
7
+ /** Live source rows in committed rewrite groups. */
8
+ rowsSucceeded: number;
9
+ /** Planned live rows not committed by this job. */
10
+ rowsFailed: number;
11
+ /** Percentage of planned live rows committed, from 0 to 100. */
12
+ completionPercentage: number;
13
+ /** Files added, including deletion files; null if an older worker omitted it. */
14
+ filesAdded: number | null;
15
+ /** Files removed, including deletion files; null if an older worker omitted it. */
16
+ filesRemoved: number | null;
17
+ /** Fragments added by committed rewrites; null if an older worker omitted it. */
18
+ fragmentsAdded: number | null;
19
+ /** Fragments removed by committed rewrites; null if an older worker omitted it. */
20
+ fragmentsRemoved: number | null;
21
+ }
22
+ /** @internal */
23
+ export declare function decodeCompactionResult(value: unknown): CompactionResult;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // SPDX-FileCopyrightText: Copyright The LanceDB Authors
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.decodeCompactionResult = decodeCompactionResult;
6
+ /** @internal */
7
+ function decodeCompactionResult(value) {
8
+ // The Rust typed-job decoder validates the wire payload before it reaches JS.
9
+ const result = value;
10
+ return {
11
+ moreWork: result.more_work,
12
+ partialCommit: result.partial_commit,
13
+ rowsSucceeded: result.rows_succeeded,
14
+ rowsFailed: result.rows_failed,
15
+ completionPercentage: result.completion_percentage,
16
+ filesAdded: result.files_added ?? null,
17
+ filesRemoved: result.files_removed ?? null,
18
+ fragmentsAdded: result.fragments_added ?? null,
19
+ fragmentsRemoved: result.fragments_removed ?? null,
20
+ };
21
+ }
@@ -440,7 +440,7 @@ export declare abstract class Connection {
440
440
  * result, failure and event history, so there is no separate
441
441
  * connection-level call for any of them.
442
442
  */
443
- abstract openJob(jobId: string): Promise<Job>;
443
+ abstract openJob<T = void>(jobId: string): Promise<Job<T>>;
444
444
  /**
445
445
  * Iterate lazily over server-side jobs across the database's tables.
446
446
  * Use `for await...of`. Options control page size and the starting token.
@@ -518,7 +518,7 @@ export declare class LocalConnection extends Connection {
518
518
  createNamespace(namespacePath: string[], options?: Partial<CreateNamespaceOptions>): Promise<CreateNamespaceResponse>;
519
519
  dropNamespace(namespacePath: string[], options?: Partial<DropNamespaceOptions>): Promise<DropNamespaceResponse>;
520
520
  renameTable(currentName: string, newName: string, options?: RenameTableOptions): Promise<void>;
521
- openJob(jobId: string): Promise<Job>;
521
+ openJob<T = void>(jobId: string): Promise<Job<T>>;
522
522
  listJobs(options?: ListingOptions): Listing<JobInfo>;
523
523
  cancelJob(jobId: string): Promise<boolean>;
524
524
  pauseJob(jobId: string): Promise<string>;
package/dist/index.d.ts CHANGED
@@ -14,10 +14,10 @@ export type { BlobData, BlobInput, BlobOptions, BlobRange, BlobRangeRequest, Blo
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";
17
- export type { JobProgress, JobProgressCallback } from "./job";
17
+ export type { JobProgress, JobProgressCallback, JobWaitOptions } from "./job";
18
18
  export { AutoQuery, ExecutableQuery, Query, QueryBase, VectorQuery, TakeQuery, AnalyzePlanDistributedMetrics, BlobMode, QueryExecutionOptions, ColumnOrdering, FullTextSearchOptions, RecordBatchIterator, FullTextQuery, MatchQuery, PhraseQuery, BoostQuery, MultiMatchQuery, BooleanQuery, FullTextQueryType, Operator, Occur, } from "./query";
19
19
  export { Index, IndexOptions, IvfPqOptions, IvfRqOptions, IvfFlatOptions, HnswPqOptions, HnswSqOptions, FtsOptions, BaseTokenizer, } from "./indices";
20
- export { Table, FunctionColumnAutoRefreshStatus, FunctionColumnLastRefreshJob, FunctionColumnStatus, FunctionColumnVersionStatus, Branches, BranchColumnSummary, BranchColumnChange, BranchIndexSummary, BranchRowCountSummary, CherryPickError, BranchDiff, CherryPickPreview, CherryPickResult, AddDataOptions, UpdateOptions, OptimizeOptions, CompactionOptions, Version, WriteProgress, FtsToken, TokenizeTableOptions, RTEWriteSpec, RTEStats, TableShardStats, SsTableStats, MemtableStats, ColumnAlteration, FieldMetadataUpdate, } from "./table";
20
+ export { Table, FunctionColumnAutoRefreshStatus, FunctionColumnLastRefreshJob, FunctionColumnStatus, FunctionColumnVersionStatus, Branches, BranchColumnSummary, BranchColumnChange, BranchIndexSummary, BranchRowCountSummary, CherryPickError, BranchDiff, CherryPickPreview, CherryPickResult, AddDataOptions, UpdateOptions, OptimizeOptions, CompactionOptions, PrewarmDataOptions, Version, WriteProgress, FtsToken, TokenizeTableOptions, RTEWriteSpec, RTEStats, TableShardStats, SsTableStats, MemtableStats, ColumnAlteration, FieldMetadataUpdate, } from "./table";
21
21
  export { HeaderProvider, StaticHeaderProvider, OAuthHeaderProvider, TokenResponse, } from "./header";
22
22
  export { ClientAuthMethod, OAuthConfig, OAuthFlowType, OAuthSession, SessionLogout, SessionStatus, TokenCacheOptions, } from "./oauth";
23
23
  export { MergeInsertBuilder, WriteExecutionOptions } from "./merge";
@@ -253,3 +253,5 @@ export declare function connectNamespace(implName: "rest", config: RestNamespace
253
253
  export declare function connectNamespace(implName: string, properties: Record<string, string>, options?: Partial<ConnectNamespaceOptions>): Promise<Connection>;
254
254
  export { Catalog, CatalogOptions, DatabaseNames, connectCatalog, } from "./catalog";
255
255
  export { Listing, ListingOptions } from "./listing";
256
+ export type { CompactionResult } from "./compaction";
257
+ export type { PrewarmDataResult } from "./prewarm";
package/dist/job.d.ts CHANGED
@@ -29,6 +29,19 @@ export interface JobProgress {
29
29
  rows_skipped?: number | null;
30
30
  rows_remaining?: number | null;
31
31
  rows_failed?: number | null;
32
+ /** Maintenance work observations; rewritten rows are not committed rows. */
33
+ groups_planned?: number | null;
34
+ groups_completed?: number | null;
35
+ rows_rewritten?: number | null;
36
+ executors_targeted?: number | null;
37
+ executors_completed?: number | null;
38
+ executors_partial?: number | null;
39
+ executors_active?: number | null;
40
+ executors_failed?: number | null;
41
+ fragments_selected?: number | null;
42
+ ranges_completed?: number | null;
43
+ ranges_planned?: number | null;
44
+ bytes_read?: number | null;
32
45
  /** Execution identity and sample time used for client-side ETA derivation. */
33
46
  execution_epoch?: number | null;
34
47
  sample_at_millis?: number | null;
@@ -39,6 +52,17 @@ export interface JobProgress {
39
52
  }
40
53
  /** Callback for progress snapshots observed while waiting for a job. */
41
54
  export type JobProgressCallback = (progress: JobProgress) => void;
55
+ /** Client-side controls for waiting without cancelling the underlying job. */
56
+ export interface JobWaitOptions {
57
+ /**
58
+ * Maximum wait in milliseconds, including status requests and polling backoff.
59
+ * Must be a nonnegative safe integer. Omit to wait indefinitely; zero allows
60
+ * only an immediately ready result.
61
+ */
62
+ timeoutMs?: number;
63
+ /** Observe progress using the same poller that waits for completion. */
64
+ onProgress?: JobProgressCallback;
65
+ }
42
66
  /**
43
67
  * A handle to an operation that may still be running.
44
68
  *
@@ -56,9 +80,10 @@ export type JobProgressCallback = (progress: JobProgress) => void;
56
80
  *
57
81
  * @hideconstructor
58
82
  */
59
- export declare class Job {
83
+ export declare class Job<T = void> {
60
84
  private readonly inner;
61
- constructor(inner: NativeJob);
85
+ private readonly resultDecoder?;
86
+ constructor(inner: NativeJob, resultDecoder?: (value: unknown) => T);
62
87
  /**
63
88
  * Identifies the operation on the server that is running it.
64
89
  *
@@ -112,8 +137,18 @@ export declare class Job {
112
137
  * synchronous observer: its return value is ignored and not awaited. If it
113
138
  * throws, the error is logged with `console.warn` and waiting continues; a
114
139
  * callback exception does not reject `wait`.
140
+ *
141
+ * Pass an options object to set a client-side timeout. Expiry rejects with an
142
+ * error and stops this wait, including pending status requests and backoff.
143
+ * The operation continues; use the same handle to wait again. Registry jobs
144
+ * can also be reopened with `Connection.openJob`; query IDs cannot.
145
+ *
146
+ * @example
147
+ * ```ts
148
+ * const result = await job.wait({ timeoutMs: 60_000, onProgress: console.log });
149
+ * ```
115
150
  */
116
- wait(progressCallback?: JobProgressCallback): Promise<void>;
151
+ wait(optionsOrProgress?: JobWaitOptions | JobProgressCallback): Promise<T>;
117
152
  /** Request cancellation. Cancelling a finished operation is a no-op. */
118
153
  cancel(): Promise<void>;
119
154
  /**
package/dist/job.js CHANGED
@@ -4,6 +4,8 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.Job = void 0;
6
6
  const apache_arrow_1 = require("apache-arrow");
7
+ const compaction_1 = require("./compaction");
8
+ const prewarm_1 = require("./prewarm");
7
9
  /**
8
10
  * A handle to an operation that may still be running.
9
11
  *
@@ -23,8 +25,16 @@ const apache_arrow_1 = require("apache-arrow");
23
25
  */
24
26
  class Job {
25
27
  inner;
26
- constructor(inner) {
28
+ resultDecoder;
29
+ constructor(inner, resultDecoder) {
27
30
  this.inner = inner;
31
+ this.resultDecoder =
32
+ resultDecoder ??
33
+ (inner.jobType === "prewarm_page_cache"
34
+ ? prewarm_1.decodePrewarmDataResult
35
+ : inner.jobType === "compact"
36
+ ? compaction_1.decodeCompactionResult
37
+ : undefined);
28
38
  }
29
39
  /**
30
40
  * Identifies the operation on the server that is running it.
@@ -100,19 +110,53 @@ class Job {
100
110
  * synchronous observer: its return value is ignored and not awaited. If it
101
111
  * throws, the error is logged with `console.warn` and waiting continues; a
102
112
  * callback exception does not reject `wait`.
113
+ *
114
+ * Pass an options object to set a client-side timeout. Expiry rejects with an
115
+ * error and stops this wait, including pending status requests and backoff.
116
+ * The operation continues; use the same handle to wait again. Registry jobs
117
+ * can also be reopened with `Connection.openJob`; query IDs cannot.
118
+ *
119
+ * @example
120
+ * ```ts
121
+ * const result = await job.wait({ timeoutMs: 60_000, onProgress: console.log });
122
+ * ```
103
123
  */
104
- async wait(progressCallback) {
105
- if (progressCallback === undefined) {
106
- return this.inner.wait();
124
+ async wait(optionsOrProgress) {
125
+ const options = typeof optionsOrProgress === "function"
126
+ ? { onProgress: optionsOrProgress }
127
+ : (optionsOrProgress ?? {});
128
+ if (typeof options !== "object" || Array.isArray(options)) {
129
+ throw new TypeError("wait expects an options object or a progress callback");
107
130
  }
108
- return this.inner.wait((progress) => {
109
- try {
110
- progressCallback(this.enrichProgress(progress));
131
+ for (const key of Object.keys(options)) {
132
+ if (key !== "timeoutMs" && key !== "onProgress") {
133
+ throw new TypeError(`Unknown job wait option: ${key}`);
111
134
  }
112
- catch (error) {
113
- console.warn("Job progress callback threw:", error);
114
- }
115
- });
135
+ }
136
+ const { timeoutMs, onProgress: progressCallback } = options;
137
+ if (timeoutMs !== undefined &&
138
+ (!Number.isSafeInteger(timeoutMs) || timeoutMs < 0)) {
139
+ throw new RangeError("timeoutMs must be a nonnegative safe integer");
140
+ }
141
+ if (progressCallback !== undefined &&
142
+ typeof progressCallback !== "function") {
143
+ throw new TypeError("onProgress must be a function");
144
+ }
145
+ const callback = progressCallback === undefined
146
+ ? undefined
147
+ : (progress) => {
148
+ try {
149
+ progressCallback(this.enrichProgress(progress));
150
+ }
151
+ catch (error) {
152
+ console.warn("Job progress callback threw:", error);
153
+ }
154
+ };
155
+ if (this.resultDecoder !== undefined) {
156
+ return this.resultDecoder(await this.inner.waitResult(callback, timeoutMs));
157
+ }
158
+ await this.inner.wait(callback, timeoutMs);
159
+ return undefined;
116
160
  }
117
161
  /** Request cancellation. Cancelling a finished operation is a no-op. */
118
162
  async cancel() {
package/dist/native.d.ts CHANGED
@@ -197,7 +197,9 @@ export declare class Job {
197
197
  * supplied, observe the same progress snapshots fetched by the existing
198
198
  * backend poller without starting another polling loop.
199
199
  */
200
- wait(progressCallback?: (progress: Record<string, unknown>) => void): Promise<void>
200
+ wait(progressCallback?: (progress: Record<string, unknown>) => void, timeoutMs?: number): Promise<void>
201
+ /** The typed terminal value used by result-returning SDK operations. */
202
+ waitResult(progressCallback?: (progress: Record<string, unknown>) => void, timeoutMs?: number): Promise<any | null>
201
203
  /** Request cancellation. Cancelling a finished operation is a no-op. */
202
204
  cancel(): Promise<void>
203
205
  /**
@@ -447,6 +449,7 @@ export declare class Table {
447
449
  dropIndex(indexName: string): Promise<void>
448
450
  prewarmIndex(indexName: string): Promise<void>
449
451
  prewarmData(columns?: Array<string> | undefined | null): Promise<void>
452
+ prewarmDataAsync(options?: PrewarmDataOptions | undefined | null): Promise<Job>
450
453
  waitForIndex(indexNames: Array<string>, timeoutS: number): Promise<void>
451
454
  stats(): Promise<TableStatistics>
452
455
  initialStorageOptions(): Promise<Record<string, string> | null>
@@ -500,6 +503,7 @@ export declare class Table {
500
503
  branches(): Promise<Branches>
501
504
  /** The branch this handle is scoped to, or `null` for the main branch. */
502
505
  currentBranch(): string | null
506
+ compactAsync(options?: CompactionOptions | undefined | null): Promise<Job>
503
507
  optimize(beforeTimestampMs?: number | undefined | null, deleteUnverified?: boolean | undefined | null, compactionOptions?: CompactionOptions | undefined | null): Promise<OptimizeStats>
504
508
  listIndices(): Promise<Array<IndexConfig>>
505
509
  tokenize(query: string, column?: string | undefined | null, indexName?: string | undefined | null): Promise<Array<FtsToken>>
@@ -1298,6 +1302,13 @@ export interface OptimizeStats {
1298
1302
  /** Create a permutation builder for the given table */
1299
1303
  export declare function permutationBuilder(table: Table): PermutationBuilder
1300
1304
 
1305
+ /** Settings for durable data-cache prewarm submission. */
1306
+ export interface PrewarmDataOptions {
1307
+ columns?: Array<string>
1308
+ filter?: string
1309
+ concurrency?: number
1310
+ }
1311
+
1301
1312
  /**
1302
1313
  * Options for `Table.refreshColumn` and `Table.refreshColumnAsync`. Every
1303
1314
  * option is LanceDB Enterprise only; a LanceDB Embedded refresh ignores
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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
79
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
98
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
123
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
142
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
162
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
181
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
204
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
222
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
241
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
265
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
284
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
309
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
328
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
349
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
368
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
389
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
408
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
429
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
448
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
469
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
488
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
508
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
527
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
551
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
570
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 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.19' && 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.19 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
589
+ if (bindingPackageVersion !== '0.42.0-beta.20' && 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.20 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
591
591
  }
592
592
  return binding;
593
593
  }
@@ -0,0 +1,19 @@
1
+ /** Reported executor work for a pinned snapshot; unavailable measurements stay null. */
2
+ export interface PrewarmDataResult {
3
+ /** The source snapshot captured by submission. */
4
+ tableVersion: number;
5
+ /** Reported executors targeted, or null when unavailable. */
6
+ executorsTargeted: number | null;
7
+ /** Executors that finished successfully or partially, or null when unavailable. */
8
+ executorsCompleted: number | null;
9
+ /** Subset of completed executors reporting partial warming, or null when unavailable. */
10
+ executorsPartial: number | null;
11
+ /** Reported fragments selected, or null when unavailable. */
12
+ fragmentsSelected: number | null;
13
+ /** Reported ranges completed, or null when unavailable. */
14
+ rangesCompleted: number | null;
15
+ /** Reported bytes read, or null when unavailable. */
16
+ bytesRead: number | null;
17
+ }
18
+ /** @internal */
19
+ export declare function decodePrewarmDataResult(value: unknown): PrewarmDataResult;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // SPDX-FileCopyrightText: Copyright The LanceDB Authors
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.decodePrewarmDataResult = decodePrewarmDataResult;
6
+ /** @internal */
7
+ function decodePrewarmDataResult(value) {
8
+ // Rust validates the typed wire result before handing it to JavaScript.
9
+ const result = value;
10
+ return {
11
+ tableVersion: result.table_version,
12
+ executorsTargeted: result.executors_targeted ?? null,
13
+ executorsCompleted: result.executors_completed ?? null,
14
+ executorsPartial: result.executors_partial ?? null,
15
+ fragmentsSelected: result.fragments_selected ?? null,
16
+ rangesCompleted: result.ranges_completed ?? null,
17
+ bytesRead: result.bytes_read ?? null,
18
+ };
19
+ }
package/dist/table.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { CompactionResult } from "./compaction";
2
+ import { PrewarmDataResult } from "./prewarm";
1
3
  import { Table as ArrowTable, Data, DataType, Field, IntoVector, MultiVector, Schema } from "./arrow";
2
4
  import { BlobFile, BlobRangeRequest, BlobReadOptions } from "./blob";
3
5
  import { IndexOptions } from "./indices";
@@ -95,6 +97,15 @@ export interface UpdateOptions {
95
97
  */
96
98
  where: string;
97
99
  }
100
+ /** Settings for submitting a durable remote data-cache prewarm job. */
101
+ export interface PrewarmDataOptions {
102
+ /** Lance field paths to warm; omitted or empty means every column. */
103
+ columns?: string[];
104
+ /** A single SQL predicate for conservative metadata pruning. */
105
+ filter?: string;
106
+ /** Positive per-executor concurrency, at most 4294967295. */
107
+ concurrency?: number;
108
+ }
98
109
  /** Per-invocation compaction settings. Values must be safe integers. */
99
110
  export interface CompactionOptions {
100
111
  /** Positive target rows per output fragment; also affects candidate selection. */
@@ -438,21 +449,53 @@ export declare abstract class Table {
438
449
  /**
439
450
  * Prewarm one or more columns of data in the table.
440
451
  *
441
- * @param columns The columns to prewarm. If undefined, all columns are prewarmed.
442
- *
443
452
  * This will load the column data into the page cache so that future queries that
444
453
  * read those columns avoid the initial cold-start latency. This call initiates
445
454
  * prewarming and returns once the request is accepted; the warming itself may
446
- * continue in the background. Calling it on already-prewarmed columns is a
447
- * no-op on the server.
455
+ * continue in the background. Submission uses SQL PREWARM and needs Flight
456
+ * SQL connectivity. Use {@link prewarmDataAsync} to retain the job handle.
448
457
  *
449
458
  * Prewarming is generally useful for columns used in filters or projections.
450
459
  * Large columns (e.g. high-dimensional vectors or binary data) may not be
451
460
  * practical to prewarm.
452
461
  *
453
462
  * This feature is currently only supported in LanceDB Enterprise.
463
+ *
464
+ * @param options Columns, a metadata-pruning filter, and per-executor concurrency.
465
+ * Omitted or empty columns warm every column.
466
+ *
467
+ * @example
468
+ * await table.prewarmData({
469
+ * columns: ["payload"], filter: "quality > 0.7", concurrency: 4,
470
+ * });
471
+ */
472
+ abstract prewarmData(options?: PrewarmDataOptions): Promise<void>;
473
+ /**
474
+ * Submit data prewarm using the columns-array form and return after acceptance.
475
+ * @param columns Columns to warm; omitted or empty means every column.
454
476
  */
455
477
  abstract prewarmData(columns?: string[]): Promise<void>;
478
+ /**
479
+ * Submit data prewarm through SQL and return its durable warming-job handle.
480
+ *
481
+ * The table handle supplies the branch and namespace. Requires a compatible
482
+ * SQL PREWARM server and Flight SQL connectivity. Standard authorization
483
+ * requires table Select and database/namespace Usage. Status/wait use generic
484
+ * HTTP job APIs; events and cancellation retain their own privileges.
485
+ * No REST fallback or option-dropping retry is performed. Historical-version
486
+ * handles are unsupported; call `checkoutLatest()` first.
487
+ *
488
+ * Submission returns after acceptance. Use `job.wait()` for completion, or
489
+ * save `job.id` and reopen it with `db.openJob(id)`. A timeout does not cancel
490
+ * the job. After `job.refresh()`, `job.spec.table_version` is the pinned version.
491
+ *
492
+ * @example
493
+ * const job = await table.prewarmDataAsync({
494
+ * columns: ["video"], filter: "quality > 0.7", concurrency: 4,
495
+ * });
496
+ * await job.wait();
497
+ */
498
+ abstract prewarmDataAsync(options?: PrewarmDataOptions): Promise<Job<PrewarmDataResult>>;
456
499
  /**
457
500
  * Waits for asynchronous indexing to complete on the table.
458
501
  *
@@ -1012,6 +1055,23 @@ export declare abstract class Table {
1012
1055
  * out state and the read_consistency_interval, if any, will apply.
1013
1056
  */
1014
1057
  abstract restore(): Promise<void>;
1058
+ /**
1059
+ * Submit remote compaction and return its durable job after acceptance.
1060
+ *
1061
+ * Uses SQL OPTIMIZE, inheriting branch and namespace from this table. Requires
1062
+ * a compatible remote server and table Ownership plus parent Usage. Local and
1063
+ * historical-version handles are unsupported. Existing optimize() behavior is unchanged.
1064
+ * Waiting tracks the rewrite itself and returns actual row/file statistics.
1065
+ * Missing result payloads are errors; older workers can omit file counts.
1066
+ * Status, progress, events and cancellation reuse the generic HTTP job APIs.
1067
+ * Reopen with db.openJob<CompactionResult>(job.id!). A wait timeout does not cancel work.
1068
+ *
1069
+ * @example
1070
+ * const job = await table.compactAsync({ targetRowsPerFragment: 1000 });
1071
+ * const result = await job.wait();
1072
+ * console.log(result.rowsSucceeded, result.fragmentsRemoved);
1073
+ */
1074
+ compactAsync(_options?: CompactionOptions): Promise<Job<CompactionResult>>;
1015
1075
  /**
1016
1076
  * Optimize the on-disk data and indices for better performance.
1017
1077
  *
@@ -1136,7 +1196,9 @@ export declare class LocalTable extends Table {
1136
1196
  createIndexAsync(column: string, options?: Partial<IndexOptions>): Promise<Job>;
1137
1197
  dropIndex(name: string): Promise<void>;
1138
1198
  prewarmIndex(name: string): Promise<void>;
1199
+ prewarmData(options?: PrewarmDataOptions): Promise<void>;
1139
1200
  prewarmData(columns?: string[]): Promise<void>;
1201
+ prewarmDataAsync(options?: PrewarmDataOptions): Promise<Job<PrewarmDataResult>>;
1140
1202
  waitForIndex(indexNames: string[], timeoutSeconds: number): Promise<void>;
1141
1203
  takeOffsets(offsets: number[]): TakeQuery;
1142
1204
  takeRowIds(rowIds: readonly (bigint | number)[]): TakeQuery;
@@ -1178,6 +1240,7 @@ export declare class LocalTable extends Table {
1178
1240
  tags(): Promise<Tags>;
1179
1241
  branches(): Promise<Branches>;
1180
1242
  currentBranch(): string | null;
1243
+ compactAsync(options?: CompactionOptions): Promise<Job<CompactionResult>>;
1181
1244
  optimize(options?: Partial<OptimizeOptions>): Promise<OptimizeStats>;
1182
1245
  listIndices(): Promise<IndexConfig[]>;
1183
1246
  tokenize(query: string, options: TokenizeTableOptions): Promise<FtsToken[]>;
package/dist/table.js CHANGED
@@ -3,6 +3,8 @@
3
3
  // SPDX-FileCopyrightText: Copyright The LanceDB Authors
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.Branches = exports.LocalTable = exports.Table = void 0;
6
+ const compaction_1 = require("./compaction");
7
+ const prewarm_1 = require("./prewarm");
6
8
  const arrow_1 = require("./arrow");
7
9
  const blob_1 = require("./blob");
8
10
  const registry_1 = require("./embedding/registry");
@@ -34,6 +36,25 @@ class Table {
34
36
  [Symbol.for("nodejs.util.inspect.custom")]() {
35
37
  return this.display();
36
38
  }
39
+ /**
40
+ * Submit remote compaction and return its durable job after acceptance.
41
+ *
42
+ * Uses SQL OPTIMIZE, inheriting branch and namespace from this table. Requires
43
+ * a compatible remote server and table Ownership plus parent Usage. Local and
44
+ * historical-version handles are unsupported. Existing optimize() behavior is unchanged.
45
+ * Waiting tracks the rewrite itself and returns actual row/file statistics.
46
+ * Missing result payloads are errors; older workers can omit file counts.
47
+ * Status, progress, events and cancellation reuse the generic HTTP job APIs.
48
+ * Reopen with db.openJob<CompactionResult>(job.id!). A wait timeout does not cancel work.
49
+ *
50
+ * @example
51
+ * const job = await table.compactAsync({ targetRowsPerFragment: 1000 });
52
+ * const result = await job.wait();
53
+ * console.log(result.rowsSucceeded, result.fragmentsRemoved);
54
+ */
55
+ async compactAsync(_options) {
56
+ throw new Error("compaction jobs are only supported on remote tables");
57
+ }
37
58
  }
38
59
  exports.Table = Table;
39
60
  class LocalTable extends Table {
@@ -160,8 +181,18 @@ class LocalTable extends Table {
160
181
  async prewarmIndex(name) {
161
182
  await this.inner.prewarmIndex(name);
162
183
  }
163
- async prewarmData(columns) {
164
- await this.inner.prewarmData(columns);
184
+ async prewarmData(columnsOrOptions) {
185
+ await this.prewarmDataAsync(Array.isArray(columnsOrOptions)
186
+ ? { columns: columnsOrOptions }
187
+ : columnsOrOptions);
188
+ }
189
+ async prewarmDataAsync(options) {
190
+ for (const key of Object.keys(options ?? {})) {
191
+ if (!["columns", "filter", "concurrency"].includes(key)) {
192
+ throw new Error(`Unsupported data prewarm option: ${key}`);
193
+ }
194
+ }
195
+ return new job_1.Job(await this.inner.prewarmDataAsync(options), prewarm_1.decodePrewarmDataResult);
165
196
  }
166
197
  async waitForIndex(indexNames, timeoutSeconds) {
167
198
  await this.inner.waitForIndex(indexNames, timeoutSeconds);
@@ -410,20 +441,12 @@ class LocalTable extends Table {
410
441
  currentBranch() {
411
442
  return this.inner.currentBranch() ?? null;
412
443
  }
444
+ async compactAsync(options) {
445
+ validateCompactionOptions(options);
446
+ return new job_1.Job(await this.inner.compactAsync(options), compaction_1.decodeCompactionResult);
447
+ }
413
448
  async optimize(options) {
414
- // JavaScript callers can supply extra keys that TypeScript would reject.
415
- // Refuse them before the native binding can silently discard a work limit.
416
- const supported = new Set([
417
- "targetRowsPerFragment",
418
- "maxSourceRows",
419
- "ioBufferSize",
420
- "batchSize",
421
- ]);
422
- for (const key of Object.keys(options?.compactionOptions ?? {})) {
423
- if (!supported.has(key)) {
424
- throw new Error(`Unsupported compaction option: ${key}`);
425
- }
426
- }
449
+ validateCompactionOptions(options?.compactionOptions);
427
450
  return await this.inner.optimize(options?.cleanupOlderThan?.getTime(), options?.deleteUnverified, options?.compactionOptions);
428
451
  }
429
452
  async listIndices() {
@@ -560,3 +583,18 @@ function rowIdsToBigInts(rowIds) {
560
583
  return BigInt(id);
561
584
  });
562
585
  }
586
+ function validateCompactionOptions(options) {
587
+ // JavaScript callers can supply extra keys that TypeScript would reject.
588
+ // Refuse them before the native binding can silently discard a work limit.
589
+ const supported = new Set([
590
+ "targetRowsPerFragment",
591
+ "maxSourceRows",
592
+ "ioBufferSize",
593
+ "batchSize",
594
+ ]);
595
+ for (const key of Object.keys(options ?? {})) {
596
+ if (!supported.has(key)) {
597
+ throw new Error(`Unsupported compaction option: ${key}`);
598
+ }
599
+ }
600
+ }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "ann"
12
12
  ],
13
13
  "private": false,
14
- "version": "0.42.0-beta.19",
14
+ "version": "0.42.0-beta.20",
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.19",
115
- "@lancedb/lancedb-linux-x64-gnu": "0.42.0-beta.19",
116
- "@lancedb/lancedb-linux-arm64-gnu": "0.42.0-beta.19",
117
- "@lancedb/lancedb-linux-x64-musl": "0.42.0-beta.19",
118
- "@lancedb/lancedb-linux-arm64-musl": "0.42.0-beta.19",
119
- "@lancedb/lancedb-win32-x64-msvc": "0.42.0-beta.19",
120
- "@lancedb/lancedb-win32-arm64-msvc": "0.42.0-beta.19"
114
+ "@lancedb/lancedb-darwin-arm64": "0.42.0-beta.20",
115
+ "@lancedb/lancedb-linux-x64-gnu": "0.42.0-beta.20",
116
+ "@lancedb/lancedb-linux-arm64-gnu": "0.42.0-beta.20",
117
+ "@lancedb/lancedb-linux-x64-musl": "0.42.0-beta.20",
118
+ "@lancedb/lancedb-linux-arm64-musl": "0.42.0-beta.20",
119
+ "@lancedb/lancedb-win32-x64-msvc": "0.42.0-beta.20",
120
+ "@lancedb/lancedb-win32-arm64-msvc": "0.42.0-beta.20"
121
121
  },
122
122
  "peerDependencies": {
123
123
  "@types/node": ">=22",