@zilliz/milvus2-sdk-node 2.6.1 → 2.6.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/milvus/MilvusClient.js +7 -1
- package/dist/milvus/MilvusClient.js.map +1 -1
- package/dist/milvus/const/milvus.d.ts +28 -3
- package/dist/milvus/const/milvus.js +29 -1
- package/dist/milvus/const/milvus.js.map +1 -1
- package/dist/milvus/grpc/BaseClient.d.ts +1 -0
- package/dist/milvus/grpc/BaseClient.js +1 -0
- package/dist/milvus/grpc/BaseClient.js.map +1 -1
- package/dist/milvus/grpc/Collection.js +21 -2
- package/dist/milvus/grpc/Collection.js.map +1 -1
- package/dist/milvus/grpc/Data.d.ts +57 -20
- package/dist/milvus/grpc/Data.js +138 -51
- package/dist/milvus/grpc/Data.js.map +1 -1
- package/dist/milvus/proto-json/milvus.base.d.ts +164 -15
- package/dist/milvus/proto-json/milvus.base.js +165 -16
- package/dist/milvus/proto-json/milvus.base.js.map +1 -1
- package/dist/milvus/proto-json/milvus.d.ts +164 -15
- package/dist/milvus/proto-json/milvus.js +165 -16
- package/dist/milvus/proto-json/milvus.js.map +1 -1
- package/dist/milvus/proto-json/schema.base.d.ts +52 -5
- package/dist/milvus/proto-json/schema.base.js +53 -6
- package/dist/milvus/proto-json/schema.base.js.map +1 -1
- package/dist/milvus/types/Collection.d.ts +8 -2
- package/dist/milvus/types/Common.d.ts +3 -0
- package/dist/milvus/types/Data.d.ts +1 -304
- package/dist/milvus/types/Data.js +0 -1
- package/dist/milvus/types/Data.js.map +1 -1
- package/dist/milvus/types/DataTypes.d.ts +35 -0
- package/dist/milvus/types/DataTypes.js +3 -0
- package/dist/milvus/types/DataTypes.js.map +1 -0
- package/dist/milvus/types/HighLevel.d.ts +1 -1
- package/dist/milvus/types/Insert.d.ts +66 -0
- package/dist/milvus/types/Insert.js +4 -0
- package/dist/milvus/types/Insert.js.map +1 -0
- package/dist/milvus/types/Search.d.ts +147 -0
- package/dist/milvus/types/Search.js +4 -0
- package/dist/milvus/types/Search.js.map +1 -0
- package/dist/milvus/types/Segments.d.ts +68 -0
- package/dist/milvus/types/Segments.js +3 -0
- package/dist/milvus/types/Segments.js.map +1 -0
- package/dist/milvus/types/index.d.ts +4 -0
- package/dist/milvus/types/index.js +4 -0
- package/dist/milvus/types/index.js.map +1 -1
- package/dist/milvus/types.d.ts +4 -0
- package/dist/milvus/types.js +4 -1
- package/dist/milvus/types.js.map +1 -1
- package/dist/milvus/utils/Bytes.d.ts +3 -3
- package/dist/milvus/utils/Bytes.js +11 -10
- package/dist/milvus/utils/Bytes.js.map +1 -1
- package/dist/milvus/utils/Connection.d.ts +14 -0
- package/dist/milvus/utils/Connection.js +24 -0
- package/dist/milvus/utils/Connection.js.map +1 -0
- package/dist/milvus/utils/Data.d.ts +43 -0
- package/dist/milvus/utils/Data.js +297 -0
- package/dist/milvus/utils/Data.js.map +1 -0
- package/dist/milvus/utils/Format.d.ts +1 -233
- package/dist/milvus/utils/Format.js +117 -727
- package/dist/milvus/utils/Format.js.map +1 -1
- package/dist/milvus/utils/Function.d.ts +1 -21
- package/dist/milvus/utils/Function.js +1 -82
- package/dist/milvus/utils/Function.js.map +1 -1
- package/dist/milvus/utils/Schema.d.ts +59 -0
- package/dist/milvus/utils/Schema.js +256 -0
- package/dist/milvus/utils/Schema.js.map +1 -0
- package/dist/milvus/utils/Search.d.ts +193 -0
- package/dist/milvus/utils/Search.js +419 -0
- package/dist/milvus/utils/Search.js.map +1 -0
- package/dist/milvus/utils/index.d.ts +4 -0
- package/dist/milvus/utils/index.js +4 -0
- package/dist/milvus/utils/index.js.map +1 -1
- package/dist/sdk.json +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { SegmentState, SegmentLevel } from '../const';
|
|
2
|
+
import { resStatusResponse, collectionNameReq, GrpcTimeOut } from './Common';
|
|
3
|
+
export interface GetFlushStateReq extends GrpcTimeOut {
|
|
4
|
+
segmentIDs: number[];
|
|
5
|
+
}
|
|
6
|
+
export interface FlushReq extends GrpcTimeOut {
|
|
7
|
+
collection_names: string[];
|
|
8
|
+
db_name?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FlushResult extends resStatusResponse {
|
|
11
|
+
coll_segIDs: any;
|
|
12
|
+
}
|
|
13
|
+
export interface GetFlushStateResponse extends resStatusResponse {
|
|
14
|
+
flushed: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface QuerySegmentInfo {
|
|
17
|
+
segmentID: number;
|
|
18
|
+
collectionID: number;
|
|
19
|
+
partitionID: number;
|
|
20
|
+
mem_size: number;
|
|
21
|
+
num_rows: number;
|
|
22
|
+
index_name: string;
|
|
23
|
+
indexID: number;
|
|
24
|
+
nodeID: number;
|
|
25
|
+
state: SegmentState;
|
|
26
|
+
nodeIds: number[];
|
|
27
|
+
level: SegmentLevel;
|
|
28
|
+
}
|
|
29
|
+
export interface GetQuerySegmentInfoResponse extends resStatusResponse {
|
|
30
|
+
infos: QuerySegmentInfo[];
|
|
31
|
+
}
|
|
32
|
+
export interface PersistentSegmentInfo {
|
|
33
|
+
segmentID: number;
|
|
34
|
+
collectionID: number;
|
|
35
|
+
partitionID: number;
|
|
36
|
+
num_rows: number;
|
|
37
|
+
state: SegmentState;
|
|
38
|
+
}
|
|
39
|
+
export interface GePersistentSegmentInfoResponse extends resStatusResponse {
|
|
40
|
+
infos: PersistentSegmentInfo[];
|
|
41
|
+
}
|
|
42
|
+
export interface ListIndexedSegmentReq extends collectionNameReq {
|
|
43
|
+
index_name: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ListIndexedSegmentResponse extends resStatusResponse {
|
|
46
|
+
segmentIDs: number[];
|
|
47
|
+
}
|
|
48
|
+
export interface DescribeSegmentIndexDataReq extends collectionNameReq {
|
|
49
|
+
index_name: string;
|
|
50
|
+
segmentsIDs: number[];
|
|
51
|
+
}
|
|
52
|
+
export interface DescribeSegmentIndexDataResponse extends resStatusResponse {
|
|
53
|
+
index_params: any;
|
|
54
|
+
index_data: any;
|
|
55
|
+
}
|
|
56
|
+
export interface GetQuerySegmentInfoReq extends GrpcTimeOut {
|
|
57
|
+
collectionName: string;
|
|
58
|
+
dbName?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface GePersistentSegmentInfoReq extends GrpcTimeOut {
|
|
61
|
+
collectionName: string;
|
|
62
|
+
dbName?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface LoadBalanceReq extends GrpcTimeOut {
|
|
65
|
+
src_nodeID: number;
|
|
66
|
+
dst_nodeIDs?: number[];
|
|
67
|
+
sealed_segmentIDs?: number[];
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Segments.js","sourceRoot":"","sources":["../../../milvus/types/Segments.ts"],"names":[],"mappings":""}
|
|
@@ -28,4 +28,8 @@ __exportStar(require("./Client"), exports);
|
|
|
28
28
|
__exportStar(require("./MilvusIndex"), exports);
|
|
29
29
|
__exportStar(require("./HighLevel"), exports);
|
|
30
30
|
__exportStar(require("./Http"), exports);
|
|
31
|
+
__exportStar(require("./Segments"), exports);
|
|
32
|
+
__exportStar(require("./Insert"), exports);
|
|
33
|
+
__exportStar(require("./Search"), exports);
|
|
34
|
+
__exportStar(require("./DataTypes"), exports);
|
|
31
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../milvus/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,eAAe;AACf,6CAA2B;AAC3B,+CAA6B;AAC7B,yCAAuB;AACvB,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B;AAC5B,6CAA2B;AAC3B,yCAAuB;AACvB,6CAA2B;AAC3B,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B;AAC5B,yCAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../milvus/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,eAAe;AACf,6CAA2B;AAC3B,+CAA6B;AAC7B,yCAAuB;AACvB,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B;AAC5B,6CAA2B;AAC3B,yCAAuB;AACvB,6CAA2B;AAC3B,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B;AAC5B,yCAAuB;AACvB,6CAA2B;AAC3B,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B"}
|
package/dist/milvus/types.d.ts
CHANGED
|
@@ -10,3 +10,7 @@ export * from './types/Resource';
|
|
|
10
10
|
export * from './types/Client';
|
|
11
11
|
export * from './types/HighLevel';
|
|
12
12
|
export * from './types/Http';
|
|
13
|
+
export * from './types/Segments';
|
|
14
|
+
export * from './types/Insert';
|
|
15
|
+
export * from './types/Search';
|
|
16
|
+
export * from './types/DataTypes';
|
package/dist/milvus/types.js
CHANGED
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// @deprecated
|
|
18
17
|
__exportStar(require("./types/Database"), exports);
|
|
19
18
|
__exportStar(require("./types/Collection"), exports);
|
|
20
19
|
__exportStar(require("./types/Data"), exports);
|
|
@@ -27,4 +26,8 @@ __exportStar(require("./types/Resource"), exports);
|
|
|
27
26
|
__exportStar(require("./types/Client"), exports);
|
|
28
27
|
__exportStar(require("./types/HighLevel"), exports);
|
|
29
28
|
__exportStar(require("./types/Http"), exports);
|
|
29
|
+
__exportStar(require("./types/Segments"), exports);
|
|
30
|
+
__exportStar(require("./types/Insert"), exports);
|
|
31
|
+
__exportStar(require("./types/Search"), exports);
|
|
32
|
+
__exportStar(require("./types/DataTypes"), exports);
|
|
30
33
|
//# sourceMappingURL=types.js.map
|
package/dist/milvus/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../milvus/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../milvus/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,qDAAmC;AACnC,+CAA6B;AAC7B,iDAA+B;AAC/B,sDAAoC;AACpC,oDAAkC;AAClC,mDAAiC;AACjC,+CAA6B;AAC7B,mDAAiC;AACjC,iDAA+B;AAC/B,oDAAkC;AAClC,+CAA6B;AAC7B,mDAAiC;AACjC,iDAA+B;AAC/B,iDAA+B;AAC/B,oDAAkC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Root } from 'protobufjs';
|
|
3
|
-
import { FloatVector, BinaryVector, SparseFloatVector, Int8Vector,
|
|
3
|
+
import { FloatVector, BinaryVector, SparseFloatVector, Int8Vector, Float16Vector, BFloat16Vector, FieldSchema, SearchData } from '..';
|
|
4
4
|
/**
|
|
5
5
|
* Converts a float vector into bytes format.
|
|
6
6
|
*
|
|
@@ -88,9 +88,9 @@ export declare const bytesToSparseRow: (bufferData: Buffer) => SparseFloatVector
|
|
|
88
88
|
* This function builds a placeholder group in bytes format for Milvus.
|
|
89
89
|
*
|
|
90
90
|
* @param {Root} milvusProto - The root object of the Milvus protocol.
|
|
91
|
-
* @param {
|
|
91
|
+
* @param {[SearchData] | SearchData[]} data - An array of search vectors.
|
|
92
92
|
* @param {DataType} vectorDataType - The data type of the vectors.
|
|
93
93
|
*
|
|
94
94
|
* @returns {Uint8Array} The placeholder group in bytes format.
|
|
95
95
|
*/
|
|
96
|
-
export declare const buildPlaceholderGroupBytes: (milvusProto: Root, data:
|
|
96
|
+
export declare const buildPlaceholderGroupBytes: (milvusProto: Root, data: [SearchData] | SearchData[], field: FieldSchema) => Uint8Array;
|
|
@@ -247,13 +247,13 @@ exports.bytesToSparseRow = bytesToSparseRow;
|
|
|
247
247
|
* This function builds a placeholder group in bytes format for Milvus.
|
|
248
248
|
*
|
|
249
249
|
* @param {Root} milvusProto - The root object of the Milvus protocol.
|
|
250
|
-
* @param {
|
|
250
|
+
* @param {[SearchData] | SearchData[]} data - An array of search vectors.
|
|
251
251
|
* @param {DataType} vectorDataType - The data type of the vectors.
|
|
252
252
|
*
|
|
253
253
|
* @returns {Uint8Array} The placeholder group in bytes format.
|
|
254
254
|
*/
|
|
255
255
|
const buildPlaceholderGroupBytes = (milvusProto, data, field) => {
|
|
256
|
-
const {
|
|
256
|
+
const { is_function_output, _placeholderType } = field;
|
|
257
257
|
// create placeholder_group value
|
|
258
258
|
let bytes;
|
|
259
259
|
if (is_function_output) {
|
|
@@ -262,23 +262,24 @@ const buildPlaceholderGroupBytes = (milvusProto, data, field) => {
|
|
|
262
262
|
}
|
|
263
263
|
else {
|
|
264
264
|
// parse vectors to bytes
|
|
265
|
-
switch (
|
|
266
|
-
case __1.
|
|
265
|
+
switch (_placeholderType) {
|
|
266
|
+
case __1.PlaceholderType.FloatVector:
|
|
267
|
+
case __1.PlaceholderType.EmbListFloatVector:
|
|
267
268
|
bytes = data.map(v => (0, exports.f32ArrayToF32Bytes)(v));
|
|
268
269
|
break;
|
|
269
|
-
case __1.
|
|
270
|
+
case __1.PlaceholderType.BinaryVector:
|
|
270
271
|
bytes = data.map(v => (0, exports.f32ArrayToBinaryBytes)(v));
|
|
271
272
|
break;
|
|
272
|
-
case __1.
|
|
273
|
+
case __1.PlaceholderType.BFloat16Vector:
|
|
273
274
|
bytes = data.map(v => Array.isArray(v) ? (0, exports.f32ArrayToBf16Bytes)(v) : v);
|
|
274
275
|
break;
|
|
275
|
-
case __1.
|
|
276
|
+
case __1.PlaceholderType.Float16Vector:
|
|
276
277
|
bytes = data.map(v => Array.isArray(v) ? (0, exports.f32ArrayToF16Bytes)(v) : v);
|
|
277
278
|
break;
|
|
278
|
-
case __1.
|
|
279
|
+
case __1.PlaceholderType.Int8Vector:
|
|
279
280
|
bytes = data.map(v => Array.isArray(v) ? (0, exports.f32ArrayToInt8Bytes)(v) : v);
|
|
280
281
|
break;
|
|
281
|
-
case __1.
|
|
282
|
+
case __1.PlaceholderType.SparseFloatVector:
|
|
282
283
|
bytes = data.map(v => (0, exports.sparseToBytes)(v));
|
|
283
284
|
break;
|
|
284
285
|
}
|
|
@@ -290,7 +291,7 @@ const buildPlaceholderGroupBytes = (milvusProto, data, field) => {
|
|
|
290
291
|
placeholders: [
|
|
291
292
|
{
|
|
292
293
|
tag: '$0',
|
|
293
|
-
type:
|
|
294
|
+
type: _placeholderType,
|
|
294
295
|
values: bytes,
|
|
295
296
|
},
|
|
296
297
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bytes.js","sourceRoot":"","sources":["../../../milvus/utils/Bytes.ts"],"names":[],"mappings":";;;AACA,kDAAoD;AACpD,0BAaY;AAEZ;;;;;GAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAkB,EAAE,EAAE;IACvD,sBAAsB;IACtB,MAAM,CAAC,GAAG,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,oCAAoC;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AALW,QAAA,kBAAkB,sBAK7B;AAEF;;;;;GAKG;AACI,MAAM,qBAAqB,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC3D,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,oCAAoC;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAJW,QAAA,qBAAqB,yBAIhC;AAEF;;;;;GAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAoB,EAAE,EAAE;IACzD,MAAM,YAAY,GAAG,IAAI,sBAA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C;gBACF,MAAM;YAER,KAAK,mBAAe,CAAC,UAAU;gBAC7B,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACnB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,2BAAmB,EAAC,CAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAC5D,CAAC;gBACF,MAAM;YAER,KAAK,mBAAe,CAAC,iBAAiB;gBACpC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,qBAAa,EAAC,CAAsB,CAAC,CAAC,CAAC;gBAC7D,MAAM;SACT;KACF;IAED,2BAA2B;IAC3B,MAAM,gBAAgB,GAAG,WAAW,CAAC,UAAU,CAC7C,sCAAsC,CACvC,CAAC;IACF,sDAAsD;IACtD,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,MAAM,CACnD,gBAAgB,CAAC,MAAM,CAAC;QACtB,YAAY,EAAE;YACZ;gBACE,GAAG,EAAE,IAAI;gBACT,IAAI,EAAE,gBAAgB;gBACtB,MAAM,EAAE,KAAK;aACd;SACF;KACF,CAAC,CACH,CAAC,MAAM,EAAE,CAAC;IAEX,OAAO,qBAAqB,CAAC;AAC/B,CAAC,CAAC;AAlEW,QAAA,0BAA0B,8BAkErC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates an authentication string based on the provided credentials.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} data - An object containing the authentication credentials.
|
|
5
|
+
* @param {string} [data.username] - The username to use for authentication.
|
|
6
|
+
* @param {string} [data.password] - The password to use for authentication.
|
|
7
|
+
* @param {string} [data.token] - The token to use for authentication.
|
|
8
|
+
* @returns {string} The authentication string.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getAuthString: (data: {
|
|
11
|
+
username?: string;
|
|
12
|
+
password?: string;
|
|
13
|
+
token?: string;
|
|
14
|
+
}) => string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAuthString = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Generates an authentication string based on the provided credentials.
|
|
6
|
+
*
|
|
7
|
+
* @param {Object} data - An object containing the authentication credentials.
|
|
8
|
+
* @param {string} [data.username] - The username to use for authentication.
|
|
9
|
+
* @param {string} [data.password] - The password to use for authentication.
|
|
10
|
+
* @param {string} [data.token] - The token to use for authentication.
|
|
11
|
+
* @returns {string} The authentication string.
|
|
12
|
+
*/
|
|
13
|
+
const getAuthString = (data) => {
|
|
14
|
+
const { username, password, token } = data;
|
|
15
|
+
// build auth string
|
|
16
|
+
const authString = token ? token : `${username}:${password}`;
|
|
17
|
+
// Encode the username and password as a base64 string.
|
|
18
|
+
let auth = Buffer.from(authString, 'utf-8').toString('base64');
|
|
19
|
+
// if we need to create auth interceptors
|
|
20
|
+
const needAuth = (!!username && !!password) || !!token;
|
|
21
|
+
return needAuth ? auth : '';
|
|
22
|
+
};
|
|
23
|
+
exports.getAuthString = getAuthString;
|
|
24
|
+
//# sourceMappingURL=Connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Connection.js","sourceRoot":"","sources":["../../../milvus/utils/Connection.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACI,MAAM,aAAa,GAAG,CAAC,IAI7B,EAAE,EAAE;IACH,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAC3C,oBAAoB;IACpB,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC;IAC7D,uDAAuD;IACvD,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAE/D,yCAAyC;IACzC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;IACvD,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9B,CAAC,CAAC;AAdW,QAAA,aAAa,iBAcxB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { RowData, _Field, FieldData, InsertTransformers, OutputTransformers } from '../';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a dynamic row object by separating the input data into non-dynamic fields and a dynamic field.
|
|
4
|
+
*
|
|
5
|
+
* @param {RowData} rowData - The input data object.
|
|
6
|
+
* @param {Map<string, Field>} fieldMap - A map of field names to field objects.
|
|
7
|
+
* @param {string} dynamicFieldName - The name of the dynamic field.
|
|
8
|
+
* @returns {RowData} The generated dynamic row object.
|
|
9
|
+
*/
|
|
10
|
+
export declare const buildDynamicRow: (rowData: RowData, fieldMap: Map<string, _Field>, dynamicFieldName: string, functionOutputFields: string[]) => RowData;
|
|
11
|
+
/**
|
|
12
|
+
* Processes vector data from gRPC response format
|
|
13
|
+
* @param item - The vector field item from gRPC response
|
|
14
|
+
* @param transformers - Optional transformers for data conversion
|
|
15
|
+
* @returns Processed vector data
|
|
16
|
+
*/
|
|
17
|
+
export declare const processVectorData: (item: any, transformers?: OutputTransformers) => any;
|
|
18
|
+
/**
|
|
19
|
+
* Processes scalar data from gRPC response format
|
|
20
|
+
* @param item - The scalar field item from gRPC response
|
|
21
|
+
* @returns Processed scalar data
|
|
22
|
+
*/
|
|
23
|
+
export declare const processScalarData: (item: any) => any;
|
|
24
|
+
/**
|
|
25
|
+
* Processes struct arrays data from gRPC response format
|
|
26
|
+
* @param item - The struct arrays field item from gRPC response
|
|
27
|
+
* @returns Processed struct arrays data as array of objects
|
|
28
|
+
*/
|
|
29
|
+
export declare const processStructArraysData: (item: any) => any;
|
|
30
|
+
/**
|
|
31
|
+
* create a data map for each fields, resolve grpc data format
|
|
32
|
+
* If the field is a vector, split the data into chunks of the appropriate size.
|
|
33
|
+
* If the field is a scalar, decode the JSON/array data if necessary.
|
|
34
|
+
*/
|
|
35
|
+
export declare const buildFieldDataMap: (fields_data: any[], transformers?: OutputTransformers) => Map<string, RowData[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Builds the field data for a given row and column.
|
|
38
|
+
*
|
|
39
|
+
* @param {RowData} rowData - The data for the row.
|
|
40
|
+
* @param {Field} column - The column information.
|
|
41
|
+
* @returns {FieldData} The field data for the row and column.
|
|
42
|
+
*/
|
|
43
|
+
export declare const buildFieldData: (rowData: RowData, field: _Field, transformers?: InsertTransformers, rowIndex?: number) => FieldData;
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildFieldData = exports.buildFieldDataMap = exports.processStructArraysData = exports.processScalarData = exports.processVectorData = exports.buildDynamicRow = void 0;
|
|
4
|
+
const __1 = require("../");
|
|
5
|
+
/**
|
|
6
|
+
* Builds a dynamic row object by separating the input data into non-dynamic fields and a dynamic field.
|
|
7
|
+
*
|
|
8
|
+
* @param {RowData} rowData - The input data object.
|
|
9
|
+
* @param {Map<string, Field>} fieldMap - A map of field names to field objects.
|
|
10
|
+
* @param {string} dynamicFieldName - The name of the dynamic field.
|
|
11
|
+
* @returns {RowData} The generated dynamic row object.
|
|
12
|
+
*/
|
|
13
|
+
const buildDynamicRow = (rowData, fieldMap, dynamicFieldName, functionOutputFields) => {
|
|
14
|
+
const originRow = (0, __1.cloneObj)(rowData);
|
|
15
|
+
const row = {};
|
|
16
|
+
// iterate through each key in the input data object
|
|
17
|
+
for (let key in originRow) {
|
|
18
|
+
row[dynamicFieldName] = row[dynamicFieldName] || {}; // initialize the dynamic field object
|
|
19
|
+
if (fieldMap.has(key)) {
|
|
20
|
+
// if the key is in the fieldMap, add it to the non-dynamic fields
|
|
21
|
+
row[key] = originRow[key];
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
if (!functionOutputFields.includes(key)) {
|
|
25
|
+
const obj = row[dynamicFieldName];
|
|
26
|
+
// otherwise, add it to the dynamic field
|
|
27
|
+
obj[key] = originRow[key];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return row; // return the generated dynamic row object
|
|
32
|
+
};
|
|
33
|
+
exports.buildDynamicRow = buildDynamicRow;
|
|
34
|
+
/**
|
|
35
|
+
* Processes vector data from gRPC response format
|
|
36
|
+
* @param item - The vector field item from gRPC response
|
|
37
|
+
* @param transformers - Optional transformers for data conversion
|
|
38
|
+
* @returns Processed vector data
|
|
39
|
+
*/
|
|
40
|
+
const processVectorData = (item, transformers) => {
|
|
41
|
+
var _a;
|
|
42
|
+
const dataKey = item.vectors.data;
|
|
43
|
+
let field_data;
|
|
44
|
+
switch (dataKey) {
|
|
45
|
+
case 'float_vector':
|
|
46
|
+
case 'binary_vector':
|
|
47
|
+
const vectorValue = dataKey === 'float_vector'
|
|
48
|
+
? item.vectors[dataKey].data
|
|
49
|
+
: item.vectors[dataKey].toJSON().data;
|
|
50
|
+
// if binary vector , need use dim / 8 to split vector data
|
|
51
|
+
const dim = ((_a = item.vectors) === null || _a === void 0 ? void 0 : _a.data) === 'float_vector'
|
|
52
|
+
? Number(item.vectors.dim)
|
|
53
|
+
: Number(item.vectors.dim) / 8;
|
|
54
|
+
field_data = [];
|
|
55
|
+
// parse number[] to number[][] by dim
|
|
56
|
+
vectorValue.forEach((v, i) => {
|
|
57
|
+
const index = Math.floor(i / dim);
|
|
58
|
+
if (!field_data[index]) {
|
|
59
|
+
field_data[index] = [];
|
|
60
|
+
}
|
|
61
|
+
field_data[index].push(v);
|
|
62
|
+
});
|
|
63
|
+
break;
|
|
64
|
+
case 'int8_vector':
|
|
65
|
+
field_data = [];
|
|
66
|
+
const int8Dim = Number(item.vectors.dim);
|
|
67
|
+
const int8Bytes = item.vectors[dataKey];
|
|
68
|
+
const localTransformers = Object.assign({ [__1.DataType.Int8Vector]: Array.from }, transformers);
|
|
69
|
+
// split buffer data to int8 vector
|
|
70
|
+
for (let i = 0; i < int8Bytes.byteLength; i += int8Dim) {
|
|
71
|
+
const slice = int8Bytes.slice(i, i + int8Dim);
|
|
72
|
+
field_data.push(localTransformers[__1.DataType.Int8Vector](slice));
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
case 'float16_vector':
|
|
76
|
+
case 'bfloat16_vector':
|
|
77
|
+
field_data = [];
|
|
78
|
+
const f16Dim = Number(item.vectors.dim) * 2; // float16 is 2 bytes, so we need to multiply dim with 2 = one element length
|
|
79
|
+
const f16Bytes = item.vectors[dataKey];
|
|
80
|
+
// split buffer data to float16 vector(bytes)
|
|
81
|
+
for (let i = 0; i < f16Bytes.byteLength; i += f16Dim) {
|
|
82
|
+
const slice = f16Bytes.slice(i, i + f16Dim);
|
|
83
|
+
const isFloat16 = dataKey === 'float16_vector';
|
|
84
|
+
let dataType;
|
|
85
|
+
dataType = isFloat16 ? __1.DataType.Float16Vector : __1.DataType.BFloat16Vector;
|
|
86
|
+
const localTransformers = Object.assign({ [__1.DataType.BFloat16Vector]: __1.bf16BytesToF32Array, [__1.DataType.Float16Vector]: __1.f16BytesToF32Array }, transformers);
|
|
87
|
+
field_data.push(localTransformers[dataType](slice));
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
case 'sparse_float_vector':
|
|
91
|
+
const sparseVectorValue = item.vectors[dataKey].contents;
|
|
92
|
+
field_data = [];
|
|
93
|
+
sparseVectorValue.forEach((buffer, i) => {
|
|
94
|
+
field_data[i] = (0, __1.bytesToSparseRow)(buffer);
|
|
95
|
+
});
|
|
96
|
+
break;
|
|
97
|
+
case 'vector_array':
|
|
98
|
+
field_data = [];
|
|
99
|
+
const vectorArrayValue = item.vectors[dataKey].data;
|
|
100
|
+
vectorArrayValue.forEach((vector) => {
|
|
101
|
+
field_data.push((0, exports.processVectorData)({
|
|
102
|
+
vectors: Object.assign({}, vector),
|
|
103
|
+
}));
|
|
104
|
+
});
|
|
105
|
+
break;
|
|
106
|
+
default:
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
return field_data;
|
|
110
|
+
};
|
|
111
|
+
exports.processVectorData = processVectorData;
|
|
112
|
+
/**
|
|
113
|
+
* Processes scalar data from gRPC response format
|
|
114
|
+
* @param item - The scalar field item from gRPC response
|
|
115
|
+
* @returns Processed scalar data
|
|
116
|
+
*/
|
|
117
|
+
const processScalarData = (item) => {
|
|
118
|
+
// parse scalar data
|
|
119
|
+
const dataKey = item.scalars.data;
|
|
120
|
+
let field_data = item.scalars[dataKey].data;
|
|
121
|
+
// we need to handle array element specifically here
|
|
122
|
+
if (dataKey === 'array_data') {
|
|
123
|
+
field_data = field_data.map((f) => {
|
|
124
|
+
const dataKey = f.data;
|
|
125
|
+
return dataKey ? f[dataKey].data : [];
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
switch (dataKey) {
|
|
129
|
+
// decode json
|
|
130
|
+
case 'json_data':
|
|
131
|
+
field_data.forEach((buffer, i) => {
|
|
132
|
+
field_data[i] = buffer.length ? JSON.parse(buffer.toString()) : null;
|
|
133
|
+
});
|
|
134
|
+
break;
|
|
135
|
+
default:
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
// set the field data with null if item.valid_data is not empty array, it the item in valid_data is false, set the field data with null
|
|
139
|
+
if (item.valid_data && item.valid_data.length) {
|
|
140
|
+
item.valid_data.forEach((v, i) => {
|
|
141
|
+
if (!v) {
|
|
142
|
+
field_data[i] = null;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
return field_data;
|
|
147
|
+
};
|
|
148
|
+
exports.processScalarData = processScalarData;
|
|
149
|
+
/**
|
|
150
|
+
* Processes struct arrays data from gRPC response format
|
|
151
|
+
* @param item - The struct arrays field item from gRPC response
|
|
152
|
+
* @returns Processed struct arrays data as array of objects
|
|
153
|
+
*/
|
|
154
|
+
const processStructArraysData = (item) => {
|
|
155
|
+
const structArrays = item.struct_arrays;
|
|
156
|
+
const fields = structArrays.fields;
|
|
157
|
+
// Process each field using the existing processScalarData function
|
|
158
|
+
const processedFields = fields.map((field) => {
|
|
159
|
+
return {
|
|
160
|
+
fieldName: field.field_name,
|
|
161
|
+
fieldData: field.scalars
|
|
162
|
+
? (0, exports.processScalarData)(field)
|
|
163
|
+
: (0, exports.processVectorData)(field),
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
// Get the number of rows from the first processed field
|
|
167
|
+
const rowCount = processedFields[0].fieldData.length;
|
|
168
|
+
// Initialize result array
|
|
169
|
+
const result = [];
|
|
170
|
+
// Process each row
|
|
171
|
+
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
172
|
+
// Get the length of arrays in this row (assuming all fields have same array length)
|
|
173
|
+
const firstFieldArray = processedFields[0].fieldData[rowIndex];
|
|
174
|
+
const arrayLength = firstFieldArray.length;
|
|
175
|
+
// Create an array of struct objects for this row
|
|
176
|
+
const rowArray = [];
|
|
177
|
+
for (let arrayIndex = 0; arrayIndex < arrayLength; arrayIndex++) {
|
|
178
|
+
const structObject = {};
|
|
179
|
+
// Process each field in the struct
|
|
180
|
+
processedFields.forEach(({ fieldName, fieldData }) => {
|
|
181
|
+
const fieldArray = fieldData[rowIndex];
|
|
182
|
+
structObject[fieldName] = fieldArray[arrayIndex];
|
|
183
|
+
});
|
|
184
|
+
rowArray.push(structObject);
|
|
185
|
+
}
|
|
186
|
+
result.push(rowArray);
|
|
187
|
+
}
|
|
188
|
+
// Apply valid_data filtering if present
|
|
189
|
+
if (item.valid_data && item.valid_data.length) {
|
|
190
|
+
item.valid_data.forEach((v, i) => {
|
|
191
|
+
if (!v) {
|
|
192
|
+
result[i] = null;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
return result;
|
|
197
|
+
};
|
|
198
|
+
exports.processStructArraysData = processStructArraysData;
|
|
199
|
+
/**
|
|
200
|
+
* create a data map for each fields, resolve grpc data format
|
|
201
|
+
* If the field is a vector, split the data into chunks of the appropriate size.
|
|
202
|
+
* If the field is a scalar, decode the JSON/array data if necessary.
|
|
203
|
+
*/
|
|
204
|
+
const buildFieldDataMap = (fields_data, transformers) => {
|
|
205
|
+
const fieldsDataMap = new Map();
|
|
206
|
+
fields_data.forEach((item, i) => {
|
|
207
|
+
// field data
|
|
208
|
+
let field_data;
|
|
209
|
+
// parse data based on field type
|
|
210
|
+
if (item.vectors) {
|
|
211
|
+
field_data = (0, exports.processVectorData)(item, transformers);
|
|
212
|
+
}
|
|
213
|
+
else if (item.scalars) {
|
|
214
|
+
field_data = (0, exports.processScalarData)(item);
|
|
215
|
+
}
|
|
216
|
+
else if (item.struct_arrays) {
|
|
217
|
+
field_data = (0, exports.processStructArraysData)(item);
|
|
218
|
+
}
|
|
219
|
+
// Add the parsed data to the fieldsDataMap
|
|
220
|
+
fieldsDataMap.set(item.field_name, field_data);
|
|
221
|
+
});
|
|
222
|
+
return fieldsDataMap;
|
|
223
|
+
};
|
|
224
|
+
exports.buildFieldDataMap = buildFieldDataMap;
|
|
225
|
+
/**
|
|
226
|
+
* Builds the field data for a given row and column.
|
|
227
|
+
*
|
|
228
|
+
* @param {RowData} rowData - The data for the row.
|
|
229
|
+
* @param {Field} column - The column information.
|
|
230
|
+
* @returns {FieldData} The field data for the row and column.
|
|
231
|
+
*/
|
|
232
|
+
const buildFieldData = (rowData, field, transformers, rowIndex) => {
|
|
233
|
+
const { type, elementType, name, fieldMap } = field;
|
|
234
|
+
const isFloat32 = Array.isArray(rowData[name]);
|
|
235
|
+
switch (type) {
|
|
236
|
+
case __1.DataType.BinaryVector:
|
|
237
|
+
case __1.DataType.FloatVector:
|
|
238
|
+
case __1.DataType.Int8Vector:
|
|
239
|
+
return rowData[name];
|
|
240
|
+
case __1.DataType.BFloat16Vector:
|
|
241
|
+
const bf16Transformer = (transformers === null || transformers === void 0 ? void 0 : transformers[__1.DataType.BFloat16Vector]) || __1.f32ArrayToBf16Bytes;
|
|
242
|
+
return isFloat32
|
|
243
|
+
? bf16Transformer(rowData[name])
|
|
244
|
+
: rowData[name];
|
|
245
|
+
case __1.DataType.Float16Vector:
|
|
246
|
+
const f16Transformer = (transformers === null || transformers === void 0 ? void 0 : transformers[__1.DataType.Float16Vector]) || __1.f32ArrayToF16Bytes;
|
|
247
|
+
return isFloat32
|
|
248
|
+
? f16Transformer(rowData[name])
|
|
249
|
+
: rowData[name];
|
|
250
|
+
case __1.DataType.JSON:
|
|
251
|
+
return rowData[name]
|
|
252
|
+
? Buffer.from(JSON.stringify(rowData[name] || {}))
|
|
253
|
+
: Buffer.alloc(0);
|
|
254
|
+
case __1.DataType.Array:
|
|
255
|
+
const elementField = Object.assign(Object.assign({}, field), { type: elementType, fieldMap: fieldMap });
|
|
256
|
+
// Special handling for struct types
|
|
257
|
+
if (elementType == __1.DataType.Struct) {
|
|
258
|
+
// Process each struct element as if it were fields_data
|
|
259
|
+
rowData[name].forEach((structElement, elementIndex) => {
|
|
260
|
+
// get field names
|
|
261
|
+
const fieldNames = Object.keys(structElement);
|
|
262
|
+
// loop through each field name
|
|
263
|
+
fieldNames.forEach(fieldName => {
|
|
264
|
+
const structField = fieldMap.get(fieldName);
|
|
265
|
+
if (!structField) {
|
|
266
|
+
throw new Error(`${__1.ERROR_REASONS.INSERT_CHECK_WRONG_FIELD} in struct at index ${elementIndex}`);
|
|
267
|
+
}
|
|
268
|
+
// Build field data for the struct field
|
|
269
|
+
const fieldData = (0, exports.buildFieldData)({ [fieldName]: structElement[fieldName] }, structField, transformers, rowIndex);
|
|
270
|
+
// Special handling for binary and float vector types
|
|
271
|
+
const dataArray = structField.data[rowIndex] || [];
|
|
272
|
+
structField.data[rowIndex] = dataArray;
|
|
273
|
+
const isVectorType = structField.elementType === __1.DataType.BinaryVector ||
|
|
274
|
+
structField.elementType === __1.DataType.FloatVector;
|
|
275
|
+
if (isVectorType) {
|
|
276
|
+
dataArray.push(...(Array.isArray(fieldData) ? fieldData : [fieldData]));
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
dataArray.push(fieldData);
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
// Return the original data for Array of Struct
|
|
284
|
+
return rowData[name];
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
// Regular array field
|
|
288
|
+
return rowData[name] === null
|
|
289
|
+
? undefined
|
|
290
|
+
: (0, exports.buildFieldData)(rowData, elementField, transformers, rowIndex);
|
|
291
|
+
}
|
|
292
|
+
default:
|
|
293
|
+
return rowData[name] === null ? undefined : rowData[name];
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
exports.buildFieldData = buildFieldData;
|
|
297
|
+
//# sourceMappingURL=Data.js.map
|