@lancedb/lancedb 0.22.3-beta.5 → 0.22.3

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/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { Connection } from "./connection";
2
2
  import { ConnectionOptions, Session } from "./native.js";
3
3
  import { HeaderProvider } from "./header";
4
4
  export { JsHeaderProvider as NativeJsHeaderProvider } from "./native.js";
5
- export { AddColumnsSql, ConnectionOptions, IndexStatistics, IndexConfig, ClientConfig, TimeoutConfig, RetryConfig, TlsConfig, OptimizeStats, CompactionStats, RemovalStats, TableStatistics, FragmentStatistics, FragmentSummaryStats, Tags, TagContents, MergeResult, AddResult, AddColumnsResult, AlterColumnsResult, DeleteResult, DropColumnsResult, UpdateResult, SplitRandomOptions, SplitHashOptions, SplitSequentialOptions, ShuffleOptions, } from "./native.js";
5
+ export { AddColumnsSql, ConnectionOptions, IndexStatistics, IndexConfig, ClientConfig, TimeoutConfig, RetryConfig, TlsConfig, OptimizeStats, CompactionStats, RemovalStats, TableStatistics, FragmentStatistics, FragmentSummaryStats, Tags, TagContents, MergeResult, AddResult, AddColumnsResult, AlterColumnsResult, DeleteResult, DropColumnsResult, UpdateResult, SplitCalculatedOptions, SplitRandomOptions, SplitHashOptions, SplitSequentialOptions, ShuffleOptions, } from "./native.js";
6
6
  export { makeArrowTable, MakeArrowTableOptions, Data, VectorColumnOptions, } from "./arrow";
7
7
  export { Connection, CreateTableOptions, TableNamesOptions, OpenTableOptions, } from "./connection";
8
8
  export { Session } from "./native.js";
package/dist/native.d.ts CHANGED
@@ -8,16 +8,23 @@ export interface SplitRandomOptions {
8
8
  counts?: Array<number>
9
9
  fixed?: number
10
10
  seed?: number
11
+ splitNames?: Array<string>
11
12
  }
12
13
  export interface SplitHashOptions {
13
14
  columns: Array<string>
14
15
  splitWeights: Array<number>
15
16
  discardWeight?: number
17
+ splitNames?: Array<string>
16
18
  }
17
19
  export interface SplitSequentialOptions {
18
20
  ratios?: Array<number>
19
21
  counts?: Array<number>
20
22
  fixed?: number
23
+ splitNames?: Array<string>
24
+ }
25
+ export interface SplitCalculatedOptions {
26
+ calculation: string
27
+ splitNames?: Array<string>
21
28
  }
22
29
  export interface ShuffleOptions {
23
30
  seed?: number
@@ -402,6 +409,7 @@ export class NativeMergeInsertBuilder {
402
409
  execute(buf: Buffer): Promise<MergeResult>
403
410
  }
404
411
  export class PermutationBuilder {
412
+ persist(connection: Connection, tableName: string): PermutationBuilder
405
413
  /** Configure random splits */
406
414
  splitRandom(options: SplitRandomOptions): PermutationBuilder
407
415
  /** Configure hash-based splits */
@@ -409,7 +417,7 @@ export class PermutationBuilder {
409
417
  /** Configure sequential splits */
410
418
  splitSequential(options: SplitSequentialOptions): PermutationBuilder
411
419
  /** Configure calculated splits */
412
- splitCalculated(calculation: string): PermutationBuilder
420
+ splitCalculated(options: SplitCalculatedOptions): PermutationBuilder
413
421
  /** Configure shuffling */
414
422
  shuffle(options: ShuffleOptions): PermutationBuilder
415
423
  /** Configure filtering */
@@ -1,4 +1,5 @@
1
- import { PermutationBuilder as NativePermutationBuilder, ShuffleOptions, SplitHashOptions, SplitRandomOptions, SplitSequentialOptions } from "./native.js";
1
+ import { Connection } from "./connection.js";
2
+ import { PermutationBuilder as NativePermutationBuilder, ShuffleOptions, SplitCalculatedOptions, SplitHashOptions, SplitRandomOptions, SplitSequentialOptions } from "./native.js";
2
3
  import { Table } from "./table";
3
4
  /**
4
5
  * A PermutationBuilder for creating data permutations with splits, shuffling, and filtering.
@@ -13,6 +14,18 @@ export declare class PermutationBuilder {
13
14
  * @hidden
14
15
  */
15
16
  constructor(inner: NativePermutationBuilder);
17
+ /**
18
+ * Configure the permutation to be persisted.
19
+ *
20
+ * @param connection - The connection to persist the permutation to
21
+ * @param tableName - The name of the table to create
22
+ * @returns A new PermutationBuilder instance
23
+ * @example
24
+ * ```ts
25
+ * builder.persist(connection, "permutation_table");
26
+ * ```
27
+ */
28
+ persist(connection: Connection, tableName: string): PermutationBuilder;
16
29
  /**
17
30
  * Configure random splits for the permutation.
18
31
  *
@@ -67,14 +80,14 @@ export declare class PermutationBuilder {
67
80
  /**
68
81
  * Configure calculated splits for the permutation.
69
82
  *
70
- * @param calculation - SQL expression for calculating splits
83
+ * @param options - Configuration for calculated splitting
71
84
  * @returns A new PermutationBuilder instance
72
85
  * @example
73
86
  * ```ts
74
87
  * builder.splitCalculated("user_id % 3");
75
88
  * ```
76
89
  */
77
- splitCalculated(calculation: string): PermutationBuilder;
90
+ splitCalculated(options: SplitCalculatedOptions): PermutationBuilder;
78
91
  /**
79
92
  * Configure shuffling for the permutation.
80
93
  *
@@ -21,6 +21,22 @@ class PermutationBuilder {
21
21
  constructor(inner) {
22
22
  this.inner = inner;
23
23
  }
24
+ /**
25
+ * Configure the permutation to be persisted.
26
+ *
27
+ * @param connection - The connection to persist the permutation to
28
+ * @param tableName - The name of the table to create
29
+ * @returns A new PermutationBuilder instance
30
+ * @example
31
+ * ```ts
32
+ * builder.persist(connection, "permutation_table");
33
+ * ```
34
+ */
35
+ persist(connection, tableName) {
36
+ const localConnection = connection;
37
+ const newInner = this.inner.persist(localConnection.inner, tableName);
38
+ return new PermutationBuilder(newInner);
39
+ }
24
40
  /**
25
41
  * Configure random splits for the permutation.
26
42
  *
@@ -84,15 +100,15 @@ class PermutationBuilder {
84
100
  /**
85
101
  * Configure calculated splits for the permutation.
86
102
  *
87
- * @param calculation - SQL expression for calculating splits
103
+ * @param options - Configuration for calculated splitting
88
104
  * @returns A new PermutationBuilder instance
89
105
  * @example
90
106
  * ```ts
91
107
  * builder.splitCalculated("user_id % 3");
92
108
  * ```
93
109
  */
94
- splitCalculated(calculation) {
95
- const newInner = this.inner.splitCalculated(calculation);
110
+ splitCalculated(options) {
111
+ const newInner = this.inner.splitCalculated(options);
96
112
  return new PermutationBuilder(newInner);
97
113
  }
98
114
  /**
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "ann"
12
12
  ],
13
13
  "private": false,
14
- "version": "0.22.3-beta.5",
14
+ "version": "0.22.3",
15
15
  "main": "dist/index.js",
16
16
  "exports": {
17
17
  ".": "./dist/index.js",
@@ -100,14 +100,14 @@
100
100
  "reflect-metadata": "^0.2.2"
101
101
  },
102
102
  "optionalDependencies": {
103
- "@lancedb/lancedb-darwin-x64": "0.22.3-beta.5",
104
- "@lancedb/lancedb-darwin-arm64": "0.22.3-beta.5",
105
- "@lancedb/lancedb-linux-x64-gnu": "0.22.3-beta.5",
106
- "@lancedb/lancedb-linux-arm64-gnu": "0.22.3-beta.5",
107
- "@lancedb/lancedb-linux-x64-musl": "0.22.3-beta.5",
108
- "@lancedb/lancedb-linux-arm64-musl": "0.22.3-beta.5",
109
- "@lancedb/lancedb-win32-x64-msvc": "0.22.3-beta.5",
110
- "@lancedb/lancedb-win32-arm64-msvc": "0.22.3-beta.5"
103
+ "@lancedb/lancedb-darwin-x64": "0.22.3",
104
+ "@lancedb/lancedb-darwin-arm64": "0.22.3",
105
+ "@lancedb/lancedb-linux-x64-gnu": "0.22.3",
106
+ "@lancedb/lancedb-linux-arm64-gnu": "0.22.3",
107
+ "@lancedb/lancedb-linux-x64-musl": "0.22.3",
108
+ "@lancedb/lancedb-linux-arm64-musl": "0.22.3",
109
+ "@lancedb/lancedb-win32-x64-msvc": "0.22.3",
110
+ "@lancedb/lancedb-win32-arm64-msvc": "0.22.3"
111
111
  },
112
112
  "peerDependencies": {
113
113
  "apache-arrow": ">=15.0.0 <=18.1.0"