@lancedb/lancedb 0.40.0-beta.11 → 0.40.0-beta.13
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/NODEJS_THIRD_PARTY_LICENSES.md +8 -0
- package/dist/arrow.d.ts +18 -1
- package/dist/arrow.js +182 -13
- package/dist/blob.d.ts +95 -7
- package/dist/blob.js +167 -13
- package/dist/catalog.d.ts +40 -6
- package/dist/catalog.js +58 -9
- package/dist/connection.d.ts +18 -4
- package/dist/connection.js +8 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -1
- package/dist/materialized_view.d.ts +3 -9
- package/dist/materialized_view.js +4 -9
- package/dist/native.d.ts +40 -13
- package/dist/native.js +53 -52
- package/dist/query.d.ts +7 -1
- package/dist/query.js +12 -15
- package/dist/sanitize.d.ts +19 -18
- package/dist/sanitize.js +78 -11
- package/dist/schema.js +31 -3
- package/dist/table.d.ts +21 -7
- package/dist/table.js +7 -7
- package/dist/util.js +9 -0
- package/package.json +13 -9
package/dist/sanitize.js
CHANGED
|
@@ -32,8 +32,42 @@ exports.dataTypeFromName = dataTypeFromName;
|
|
|
32
32
|
// time. However, arrow-js uses instanceof which expected that the input
|
|
33
33
|
// comes from the exact same library instance. This is not always the case
|
|
34
34
|
// and so we must sanitize the input to ensure that it is compatible.
|
|
35
|
+
const arrowModule = require("apache-arrow");
|
|
35
36
|
const apache_arrow_1 = require("apache-arrow");
|
|
36
37
|
const arrow_1 = require("./arrow");
|
|
38
|
+
/**
|
|
39
|
+
* Whether `value` was created by *this* copy of apache-arrow's `ctor`.
|
|
40
|
+
*
|
|
41
|
+
* Arrow 21 overrides `Symbol.hasInstance` on `Schema`, `Field`, `Table`,
|
|
42
|
+
* `RecordBatch`, `Vector` and `Data` so that `instanceof` also matches objects
|
|
43
|
+
* built by a different copy of the library. Those are exactly the objects
|
|
44
|
+
* this module has to rebuild: the `DataType` instances nested inside them are
|
|
45
|
+
* deliberately *not* given that treatment upstream, so Arrow's own builders and
|
|
46
|
+
* writers reject them. Walk the real prototype chain instead of trusting
|
|
47
|
+
* `instanceof`.
|
|
48
|
+
*/
|
|
49
|
+
function isOwnInstance(value,
|
|
50
|
+
// biome-ignore lint/suspicious/noExplicitAny: matches any class constructor
|
|
51
|
+
ctor) {
|
|
52
|
+
return (typeof value === "object" &&
|
|
53
|
+
value !== null &&
|
|
54
|
+
Object.prototype.isPrototypeOf.call(ctor.prototype, value));
|
|
55
|
+
}
|
|
56
|
+
const NEWER_TYPES = [
|
|
57
|
+
{ name: "IntervalMonthDayNano", typeId: -31, since: 20 },
|
|
58
|
+
{ name: "LargeList", typeId: 21, since: 21 },
|
|
59
|
+
{ name: "BinaryView", typeId: 23, since: 21 },
|
|
60
|
+
{ name: "Utf8View", typeId: 24, since: 21 },
|
|
61
|
+
];
|
|
62
|
+
function newerTypeConstructor(name) {
|
|
63
|
+
const ctor = arrowModule[name];
|
|
64
|
+
if (typeof ctor !== "function") {
|
|
65
|
+
const since = NEWER_TYPES.find((t) => t.name === name)?.since;
|
|
66
|
+
throw new Error(`The Arrow type ${name} requires apache-arrow ${since} or newer, ` +
|
|
67
|
+
"but the installed apache-arrow does not provide it");
|
|
68
|
+
}
|
|
69
|
+
return ctor;
|
|
70
|
+
}
|
|
37
71
|
function createSanitizationContext() {
|
|
38
72
|
return {
|
|
39
73
|
types: new WeakMap(),
|
|
@@ -130,14 +164,21 @@ function sanitizeInterval(typeLike) {
|
|
|
130
164
|
function sanitizeList(typeLike) {
|
|
131
165
|
return sanitizeListWithContext(typeLike, createSanitizationContext());
|
|
132
166
|
}
|
|
133
|
-
function
|
|
167
|
+
function sanitizeListChildWithContext(typeLike, context, typeName) {
|
|
134
168
|
if (!("children" in typeLike) || !Array.isArray(typeLike.children)) {
|
|
135
|
-
throw Error(
|
|
169
|
+
throw Error(`Expected a ${typeName} type to have an array-like \`children\` property`);
|
|
136
170
|
}
|
|
137
171
|
if (typeLike.children.length !== 1) {
|
|
138
|
-
throw Error(
|
|
172
|
+
throw Error(`Expected a ${typeName} type to have exactly one child`);
|
|
139
173
|
}
|
|
140
|
-
return
|
|
174
|
+
return sanitizeFieldWithContext(typeLike.children[0], context);
|
|
175
|
+
}
|
|
176
|
+
function sanitizeListWithContext(typeLike, context) {
|
|
177
|
+
return new arrow_1.List(sanitizeListChildWithContext(typeLike, context, "List"));
|
|
178
|
+
}
|
|
179
|
+
function sanitizeLargeListWithContext(typeLike, context) {
|
|
180
|
+
const LargeList = newerTypeConstructor("LargeList");
|
|
181
|
+
return new LargeList(sanitizeListChildWithContext(typeLike, context, "LargeList"));
|
|
141
182
|
}
|
|
142
183
|
function sanitizeStruct(typeLike) {
|
|
143
184
|
return sanitizeStructWithContext(typeLike, createSanitizationContext());
|
|
@@ -274,7 +315,21 @@ function sanitizeTypeWithContext(typeLike, context) {
|
|
|
274
315
|
context.types.set(typeLike, type);
|
|
275
316
|
return type;
|
|
276
317
|
}
|
|
318
|
+
function sanitizeNewerTypeById(typeLike, typeId, context) {
|
|
319
|
+
const entry = NEWER_TYPES.find((t) => t.typeId === typeId);
|
|
320
|
+
if (entry === undefined) {
|
|
321
|
+
return undefined;
|
|
322
|
+
}
|
|
323
|
+
if (entry.name === "LargeList") {
|
|
324
|
+
return sanitizeLargeListWithContext(typeLike, context);
|
|
325
|
+
}
|
|
326
|
+
return new (newerTypeConstructor(entry.name))();
|
|
327
|
+
}
|
|
277
328
|
function sanitizeTypeById(typeLike, typeId, context) {
|
|
329
|
+
const newer = sanitizeNewerTypeById(typeLike, typeId, context);
|
|
330
|
+
if (newer !== undefined) {
|
|
331
|
+
return newer;
|
|
332
|
+
}
|
|
278
333
|
switch (typeId) {
|
|
279
334
|
case arrow_1.Type.NONE:
|
|
280
335
|
throw Error("Received a Type with a typeId of NONE");
|
|
@@ -286,8 +341,12 @@ function sanitizeTypeById(typeLike, typeId, context) {
|
|
|
286
341
|
return sanitizeFloat(typeLike);
|
|
287
342
|
case arrow_1.Type.Binary:
|
|
288
343
|
return new arrow_1.Binary();
|
|
344
|
+
case arrow_1.Type.LargeBinary:
|
|
345
|
+
return new arrow_1.LargeBinary();
|
|
289
346
|
case arrow_1.Type.Utf8:
|
|
290
347
|
return new arrow_1.Utf8();
|
|
348
|
+
case arrow_1.Type.LargeUtf8:
|
|
349
|
+
return new arrow_1.LargeUtf8();
|
|
291
350
|
case arrow_1.Type.Bool:
|
|
292
351
|
return new arrow_1.Bool();
|
|
293
352
|
case arrow_1.Type.Decimal:
|
|
@@ -382,7 +441,7 @@ function sanitizeField(fieldLike) {
|
|
|
382
441
|
return sanitizeFieldWithContext(fieldLike, createSanitizationContext());
|
|
383
442
|
}
|
|
384
443
|
function sanitizeFieldWithContext(fieldLike, context) {
|
|
385
|
-
if (fieldLike
|
|
444
|
+
if (isOwnInstance(fieldLike, arrow_1.Field)) {
|
|
386
445
|
return fieldLike;
|
|
387
446
|
}
|
|
388
447
|
if (typeof fieldLike !== "object" || fieldLike === null) {
|
|
@@ -425,7 +484,7 @@ function sanitizeSchema(schemaLike) {
|
|
|
425
484
|
return sanitizeSchemaWithContext(schemaLike, createSanitizationContext());
|
|
426
485
|
}
|
|
427
486
|
function sanitizeSchemaWithContext(schemaLike, context) {
|
|
428
|
-
if (schemaLike
|
|
487
|
+
if (isOwnInstance(schemaLike, arrow_1.Schema)) {
|
|
429
488
|
return schemaLike;
|
|
430
489
|
}
|
|
431
490
|
if (typeof schemaLike !== "object" || schemaLike === null) {
|
|
@@ -445,7 +504,7 @@ function sanitizeSchemaWithContext(schemaLike, context) {
|
|
|
445
504
|
return new arrow_1.Schema(sanitizedFields, metadata);
|
|
446
505
|
}
|
|
447
506
|
function sanitizeTable(tableLike) {
|
|
448
|
-
if (tableLike
|
|
507
|
+
if (isOwnInstance(tableLike, arrow_1.Table)) {
|
|
449
508
|
return tableLike;
|
|
450
509
|
}
|
|
451
510
|
if (typeof tableLike !== "object" || tableLike === null) {
|
|
@@ -463,7 +522,7 @@ function sanitizeTable(tableLike) {
|
|
|
463
522
|
return new arrow_1.Table(schema, batches);
|
|
464
523
|
}
|
|
465
524
|
function sanitizeRecordBatch(batchLike, context) {
|
|
466
|
-
if (batchLike
|
|
525
|
+
if (isOwnInstance(batchLike, arrow_1.RecordBatch)) {
|
|
467
526
|
return batchLike;
|
|
468
527
|
}
|
|
469
528
|
if (typeof batchLike !== "object" || batchLike === null) {
|
|
@@ -480,7 +539,7 @@ function sanitizeRecordBatch(batchLike, context) {
|
|
|
480
539
|
return new arrow_1.RecordBatch(schema, data);
|
|
481
540
|
}
|
|
482
541
|
function sanitizeData(dataLike, context) {
|
|
483
|
-
if (dataLike
|
|
542
|
+
if (isOwnInstance(dataLike, apache_arrow_1.Data)) {
|
|
484
543
|
return dataLike;
|
|
485
544
|
}
|
|
486
545
|
const cachedData = context.data.get(dataLike);
|
|
@@ -496,19 +555,26 @@ function sanitizeData(dataLike, context) {
|
|
|
496
555
|
context.vectors.set(dictionaryLike, dictionary);
|
|
497
556
|
}
|
|
498
557
|
}
|
|
499
|
-
|
|
558
|
+
// Arrow 21 added an eighth constructor parameter (`variadicBuffers`); older
|
|
559
|
+
// releases ignore the extra argument but their typings do not declare it.
|
|
560
|
+
const DataCtor = apache_arrow_1.Data;
|
|
561
|
+
const data = new DataCtor(sanitizeTypeWithContext(dataLike.type, context), dataLike.offset, dataLike.length, dataLike.nullCount, {
|
|
500
562
|
[apache_arrow_1.BufferType.OFFSET]: dataLike.valueOffsets,
|
|
501
563
|
[apache_arrow_1.BufferType.DATA]: dataLike.values,
|
|
502
564
|
[apache_arrow_1.BufferType.VALIDITY]: dataLike.nullBitmap,
|
|
503
565
|
[apache_arrow_1.BufferType.TYPE]: dataLike.typeIds,
|
|
504
|
-
}, dataLike.children.map((child) => sanitizeData(child, context)), dictionary);
|
|
566
|
+
}, dataLike.children.map((child) => sanitizeData(child, context)), dictionary, dataLike.variadicBuffers);
|
|
505
567
|
context.data.set(dataLike, data);
|
|
506
568
|
return data;
|
|
507
569
|
}
|
|
508
570
|
const constructorsByTypeName = {
|
|
509
571
|
null: () => new arrow_1.Null(),
|
|
510
572
|
binary: () => new arrow_1.Binary(),
|
|
573
|
+
largebinary: () => new arrow_1.LargeBinary(),
|
|
574
|
+
binaryview: () => new (newerTypeConstructor("BinaryView"))(),
|
|
511
575
|
utf8: () => new arrow_1.Utf8(),
|
|
576
|
+
largeutf8: () => new arrow_1.LargeUtf8(),
|
|
577
|
+
utf8view: () => new (newerTypeConstructor("Utf8View"))(),
|
|
512
578
|
bool: () => new arrow_1.Bool(),
|
|
513
579
|
int8: () => new arrow_1.Int8(),
|
|
514
580
|
int16: () => new arrow_1.Int16(),
|
|
@@ -529,6 +595,7 @@ const constructorsByTypeName = {
|
|
|
529
595
|
timesecond: () => new arrow_1.TimeSecond(),
|
|
530
596
|
intervaldaytime: () => new arrow_1.IntervalDayTime(),
|
|
531
597
|
intervalyearmonth: () => new arrow_1.IntervalYearMonth(),
|
|
598
|
+
intervalmonthdaynano: () => new (newerTypeConstructor("IntervalMonthDayNano"))(),
|
|
532
599
|
durationnanosecond: () => new arrow_1.DurationNanosecond(),
|
|
533
600
|
durationmicrosecond: () => new arrow_1.DurationMicrosecond(),
|
|
534
601
|
durationmillisecond: () => new arrow_1.DurationMillisecond(),
|
package/dist/schema.js
CHANGED
|
@@ -43,10 +43,18 @@ class SchemaInferrer {
|
|
|
43
43
|
else if (this.providedSchema === undefined) {
|
|
44
44
|
this.updateInferredField(path, value, row, current);
|
|
45
45
|
}
|
|
46
|
+
else if (current instanceof DeferredTypeEvidence) {
|
|
47
|
+
if (value != null) {
|
|
48
|
+
this.addSchemaField(this.providedSchema, path, value, row);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else if (current instanceof FieldTree || apache_arrow_1.DataType.isStruct(current)) {
|
|
52
|
+
assertStructValue(path, value, row);
|
|
53
|
+
}
|
|
46
54
|
}
|
|
47
55
|
addField(path, value, row) {
|
|
48
56
|
if (this.providedSchema !== undefined) {
|
|
49
|
-
this.addSchemaField(this.providedSchema, path, row);
|
|
57
|
+
this.addSchemaField(this.providedSchema, path, value, row);
|
|
50
58
|
return;
|
|
51
59
|
}
|
|
52
60
|
const evidence = this.inferType(value, path) ?? DeferredTypeEvidence.from(value, row);
|
|
@@ -58,12 +66,18 @@ class SchemaInferrer {
|
|
|
58
66
|
throw branchConflictError(conflict, row, "Struct");
|
|
59
67
|
}
|
|
60
68
|
}
|
|
61
|
-
addSchemaField(schema, path, row) {
|
|
69
|
+
addSchemaField(schema, path, value, row) {
|
|
62
70
|
const field = fieldAtPath(schema, path);
|
|
63
71
|
if (field === undefined) {
|
|
64
72
|
throw new Error(`Found field not in schema: ${path.join(".")} at row ${row}`);
|
|
65
73
|
}
|
|
66
|
-
|
|
74
|
+
if (apache_arrow_1.DataType.isStruct(field.type)) {
|
|
75
|
+
assertStructValue(path, value, row);
|
|
76
|
+
}
|
|
77
|
+
// Nulls are kept as deferred evidence so that a struct field seen first as
|
|
78
|
+
// null can be replaced by a record in a later row, just as a record seen
|
|
79
|
+
// first already ignores later nulls.
|
|
80
|
+
const conflict = this.fields.set(path, DeferredTypeEvidence.from(value, row) ?? field.type, (existing) => existing instanceof DeferredTypeEvidence && existing.isOnlyNulls());
|
|
67
81
|
if (conflict !== undefined) {
|
|
68
82
|
throw branchConflictError(conflict, row, "Struct");
|
|
69
83
|
}
|
|
@@ -332,6 +346,20 @@ function assertSupportedValue(value, field, row) {
|
|
|
332
346
|
throw new Error(`Unsupported object value for field ${field} at row ${row}.`);
|
|
333
347
|
}
|
|
334
348
|
}
|
|
349
|
+
/**
|
|
350
|
+
* Rejects primitives, arrays, and typed arrays given for a struct field, which
|
|
351
|
+
* would otherwise be written as a struct with every child null.
|
|
352
|
+
*/
|
|
353
|
+
function assertStructValue(path, value, row) {
|
|
354
|
+
if (value == null ||
|
|
355
|
+
(typeof value === "object" &&
|
|
356
|
+
!Array.isArray(value) &&
|
|
357
|
+
!ArrayBuffer.isView(value))) {
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
const kind = typeof value === "object" ? value.constructor.name : typeof value;
|
|
361
|
+
throw new Error(`Expected a struct value for field ${path.join(".")} at row ${row}, got ${kind}.`);
|
|
362
|
+
}
|
|
335
363
|
function fieldAtPath(schema, path) {
|
|
336
364
|
let fields = schema.fields;
|
|
337
365
|
let field;
|
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 } from "./blob";
|
|
2
|
+
import { BlobFile, BlobReadOptions } from "./blob";
|
|
3
3
|
import { IndexOptions } from "./indices";
|
|
4
4
|
import { Job } from "./job";
|
|
5
5
|
import { MergeInsertBuilder } from "./merge";
|
|
@@ -65,6 +65,16 @@ export interface AddDataOptions {
|
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
67
|
progress: (progress: WriteProgress) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Whether blob URIs outside registered external bases may be written.
|
|
70
|
+
*
|
|
71
|
+
* Defaults to `false`. This option is supported only for local/native
|
|
72
|
+
* tables; remote tables return an error when it is enabled. An enabled write
|
|
73
|
+
* stores the absolute URI reference without registering a base or copying
|
|
74
|
+
* the external object into the database. The object must remain accessible
|
|
75
|
+
* when the blob is read later.
|
|
76
|
+
*/
|
|
77
|
+
allowExternalBlobOutsideBases?: boolean;
|
|
68
78
|
}
|
|
69
79
|
export interface UpdateOptions {
|
|
70
80
|
/**
|
|
@@ -424,8 +434,12 @@ export declare abstract class Table {
|
|
|
424
434
|
* Reads the table's current checkout. IDs from another version can fail after
|
|
425
435
|
* compaction unless stable row ids are enabled. Results keep input order and
|
|
426
436
|
* duplicates. Null blobs are `null`. Empty blobs are empty buffers.
|
|
437
|
+
* Remote servers limit each request to 1024 row IDs and 64 MiB of blob bytes.
|
|
438
|
+
* The client splits requests automatically and reads an individual larger
|
|
439
|
+
* blob through the Range route. This method still materializes all bytes in
|
|
440
|
+
* memory; use {@link Table.fetchBlobFiles} for large values.
|
|
427
441
|
*/
|
|
428
|
-
abstract fetchBlobs(column: string, rowIds: readonly (bigint | number)[]): Promise<(Buffer | null)[]>;
|
|
442
|
+
abstract fetchBlobs(column: string, rowIds: readonly (bigint | number)[], options?: BlobReadOptions): Promise<(Buffer | null)[]>;
|
|
429
443
|
/**
|
|
430
444
|
* Opens lazy blob handles for `column` at the given row IDs using the
|
|
431
445
|
* table's current checkout.
|
|
@@ -433,7 +447,7 @@ export declare abstract class Table {
|
|
|
433
447
|
* Preserves input order, duplicates, and nulls. Use this for large payloads.
|
|
434
448
|
* See {@link Table.fetchBlobs} for row-ID validity across versions.
|
|
435
449
|
*/
|
|
436
|
-
abstract fetchBlobFiles(column: string, rowIds: readonly (bigint | number)[]): Promise<(BlobFile | null)[]>;
|
|
450
|
+
abstract fetchBlobFiles(column: string, rowIds: readonly (bigint | number)[], options?: BlobReadOptions): Promise<(BlobFile | null)[]>;
|
|
437
451
|
/**
|
|
438
452
|
* Create a search query to find the nearest neighbors
|
|
439
453
|
* of the given query
|
|
@@ -542,7 +556,7 @@ export declare abstract class Table {
|
|
|
542
556
|
* it: rejects tables that carry no view definition.
|
|
543
557
|
* @ignore
|
|
544
558
|
*/
|
|
545
|
-
abstract refreshMaterializedView(
|
|
559
|
+
abstract refreshMaterializedView(sourceVersion?: number): Promise<RefreshMaterializedViewResult>;
|
|
546
560
|
/** @ignore */
|
|
547
561
|
abstract materializedViewDefinition(): Promise<string>;
|
|
548
562
|
/**
|
|
@@ -904,8 +918,8 @@ export declare class LocalTable extends Table {
|
|
|
904
918
|
takeOffsets(offsets: number[]): TakeQuery;
|
|
905
919
|
takeRowIds(rowIds: readonly (bigint | number)[]): TakeQuery;
|
|
906
920
|
blobColumns(): Promise<string[]>;
|
|
907
|
-
fetchBlobs(column: string, rowIds: readonly (bigint | number)[]): Promise<(Buffer | null)[]>;
|
|
908
|
-
fetchBlobFiles(column: string, rowIds: readonly (bigint | number)[]): Promise<(BlobFile | null)[]>;
|
|
921
|
+
fetchBlobs(column: string, rowIds: readonly (bigint | number)[], options?: BlobReadOptions): Promise<(Buffer | null)[]>;
|
|
922
|
+
fetchBlobFiles(column: string, rowIds: readonly (bigint | number)[], options?: BlobReadOptions): Promise<(BlobFile | null)[]>;
|
|
909
923
|
query(): Query;
|
|
910
924
|
search(query: string | IntoVector | MultiVector | FullTextQuery, queryType?: string, ftsColumns?: string | string[]): VectorQuery | Query | AutoQuery;
|
|
911
925
|
vectorSearch(vector: IntoVector | MultiVector): VectorQuery;
|
|
@@ -915,7 +929,7 @@ export declare class LocalTable extends Table {
|
|
|
915
929
|
refreshColumn(column: string): Promise<RefreshColumnResult>;
|
|
916
930
|
refreshColumnAsync(column: string): Promise<Job>;
|
|
917
931
|
functionErrors(options?: FunctionErrorsOptions): Promise<FunctionErrors>;
|
|
918
|
-
refreshMaterializedView(
|
|
932
|
+
refreshMaterializedView(sourceVersion?: number): Promise<RefreshMaterializedViewResult>;
|
|
919
933
|
materializedViewDefinition(): Promise<string>;
|
|
920
934
|
alterColumns(columnAlterations: ColumnAlteration[]): Promise<AlterColumnsResult>;
|
|
921
935
|
updateFieldMetadata(updates: FieldMetadataUpdate[]): Promise<UpdateFieldMetadataResult>;
|
package/dist/table.js
CHANGED
|
@@ -84,7 +84,7 @@ class LocalTable extends Table {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
: undefined;
|
|
87
|
-
return await this.inner.add(buffer, mode, progress);
|
|
87
|
+
return await this.inner.add(buffer, mode, progress, options?.allowExternalBlobOutsideBases);
|
|
88
88
|
}
|
|
89
89
|
async update(optsOrUpdates, options) {
|
|
90
90
|
const isValues = "values" in optsOrUpdates && typeof optsOrUpdates.values !== "string";
|
|
@@ -169,13 +169,13 @@ class LocalTable extends Table {
|
|
|
169
169
|
blobColumns() {
|
|
170
170
|
return this.inner.blobColumns();
|
|
171
171
|
}
|
|
172
|
-
async fetchBlobs(column, rowIds) {
|
|
173
|
-
const values = await this.inner.fetchBlobs(column, rowIdsToBigInts(rowIds));
|
|
172
|
+
async fetchBlobs(column, rowIds, options) {
|
|
173
|
+
const values = await (0, blob_1.runWithSignal)(options?.signal, (signal) => this.inner.fetchBlobs(column, rowIdsToBigInts(rowIds), signal));
|
|
174
174
|
// N-API Option maps missing values to undefined. Collapse those to null.
|
|
175
175
|
return values.map((value) => value ?? null);
|
|
176
176
|
}
|
|
177
|
-
async fetchBlobFiles(column, rowIds) {
|
|
178
|
-
const files = await this.inner.fetchBlobFiles(column, rowIdsToBigInts(rowIds));
|
|
177
|
+
async fetchBlobFiles(column, rowIds, options) {
|
|
178
|
+
const files = await (0, blob_1.runWithSignal)(options?.signal, (signal) => this.inner.fetchBlobFiles(column, rowIdsToBigInts(rowIds), signal));
|
|
179
179
|
// N-API Option maps missing values to undefined. Collapse those to null.
|
|
180
180
|
return files.map((file) => file == null ? null : blob_1.BlobFile.fromNative(file));
|
|
181
181
|
}
|
|
@@ -280,8 +280,8 @@ class LocalTable extends Table {
|
|
|
280
280
|
(0, materialized_view_1.validateNonNegativeInteger)(options?.limit, "limit");
|
|
281
281
|
return await this.inner.functionErrors(options);
|
|
282
282
|
}
|
|
283
|
-
async refreshMaterializedView(
|
|
284
|
-
return await this.inner.refreshMaterializedView(
|
|
283
|
+
async refreshMaterializedView(sourceVersion) {
|
|
284
|
+
return await this.inner.refreshMaterializedView(sourceVersion);
|
|
285
285
|
}
|
|
286
286
|
async materializedViewDefinition() {
|
|
287
287
|
return await this.inner.materializedViewDefinition();
|
package/dist/util.js
CHANGED
|
@@ -10,6 +10,15 @@ function toSQL(value) {
|
|
|
10
10
|
return `'${value.replace(/'/g, "''")}'`;
|
|
11
11
|
}
|
|
12
12
|
else if (typeof value === "number") {
|
|
13
|
+
// toString() gives "NaN" / "Infinity", which SQL reads as column names.
|
|
14
|
+
if (Number.isNaN(value)) {
|
|
15
|
+
return "CAST('NaN' AS DOUBLE)";
|
|
16
|
+
}
|
|
17
|
+
else if (!Number.isFinite(value)) {
|
|
18
|
+
return value > 0
|
|
19
|
+
? "CAST('Infinity' AS DOUBLE)"
|
|
20
|
+
: "CAST('-Infinity' AS DOUBLE)";
|
|
21
|
+
}
|
|
13
22
|
return value.toString();
|
|
14
23
|
}
|
|
15
24
|
else if (typeof value === "boolean") {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"ann"
|
|
12
12
|
],
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "0.40.0-beta.
|
|
14
|
+
"version": "0.40.0-beta.13",
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": "./dist/index.js",
|
|
@@ -49,10 +49,14 @@
|
|
|
49
49
|
"@types/jest": "^29.1.2",
|
|
50
50
|
"@types/node": "22.7.4",
|
|
51
51
|
"@types/tmp": "^0.2.6",
|
|
52
|
+
"apache-arrow": "21.2.0",
|
|
52
53
|
"apache-arrow-15": "npm:apache-arrow@15.0.0",
|
|
53
54
|
"apache-arrow-16": "npm:apache-arrow@16.0.0",
|
|
54
55
|
"apache-arrow-17": "npm:apache-arrow@17.0.0",
|
|
55
56
|
"apache-arrow-18": "npm:apache-arrow@18.0.0",
|
|
57
|
+
"apache-arrow-19": "npm:apache-arrow@19.0.1",
|
|
58
|
+
"apache-arrow-20": "npm:apache-arrow@20.0.0",
|
|
59
|
+
"apache-arrow-21": "npm:apache-arrow@21.2.0",
|
|
56
60
|
"eslint": "^8.57.0",
|
|
57
61
|
"jest": "^29.7.0",
|
|
58
62
|
"shx": "^0.3.4",
|
|
@@ -106,17 +110,17 @@
|
|
|
106
110
|
"optionalDependencies": {
|
|
107
111
|
"@huggingface/transformers": "3.0.2",
|
|
108
112
|
"openai": "4.29.2",
|
|
109
|
-
"@lancedb/lancedb-darwin-arm64": "0.40.0-beta.
|
|
110
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.40.0-beta.
|
|
111
|
-
"@lancedb/lancedb-linux-arm64-gnu": "0.40.0-beta.
|
|
112
|
-
"@lancedb/lancedb-linux-x64-musl": "0.40.0-beta.
|
|
113
|
-
"@lancedb/lancedb-linux-arm64-musl": "0.40.0-beta.
|
|
114
|
-
"@lancedb/lancedb-win32-x64-msvc": "0.40.0-beta.
|
|
115
|
-
"@lancedb/lancedb-win32-arm64-msvc": "0.40.0-beta.
|
|
113
|
+
"@lancedb/lancedb-darwin-arm64": "0.40.0-beta.13",
|
|
114
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.40.0-beta.13",
|
|
115
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.40.0-beta.13",
|
|
116
|
+
"@lancedb/lancedb-linux-x64-musl": "0.40.0-beta.13",
|
|
117
|
+
"@lancedb/lancedb-linux-arm64-musl": "0.40.0-beta.13",
|
|
118
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.40.0-beta.13",
|
|
119
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.40.0-beta.13"
|
|
116
120
|
},
|
|
117
121
|
"peerDependencies": {
|
|
118
122
|
"@types/node": ">=22",
|
|
119
|
-
"apache-arrow": ">=15.0.0
|
|
123
|
+
"apache-arrow": ">=15.0.0 <22.0.0"
|
|
120
124
|
},
|
|
121
125
|
"peerDependenciesMeta": {
|
|
122
126
|
"@types/node": {
|