@milaboratories/pl-model-middle-layer 1.8.12 → 1.8.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/dist/pframe/internal_api/api_factory.d.ts +18 -0
- package/dist/pframe/internal_api/api_factory.d.ts.map +1 -1
- package/dist/pframe/internal_api/api_read.d.ts +28 -1
- package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
- package/dist/pframe/internal_api/pframe.d.ts +26 -2
- package/dist/pframe/internal_api/pframe.d.ts.map +1 -1
- package/dist/pframe/internal_api/table.d.ts +54 -0
- package/dist/pframe/internal_api/table.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/pframe/internal_api/api_factory.ts +26 -0
- package/src/pframe/internal_api/api_read.ts +37 -1
- package/src/pframe/internal_api/pframe.ts +29 -2
- package/src/pframe/internal_api/table.ts +65 -0
|
@@ -37,4 +37,22 @@ export interface PFrameFactoryAPIV2 {
|
|
|
37
37
|
* any interactions with disposed PFrame will result in exception */
|
|
38
38
|
dispose(): void;
|
|
39
39
|
}
|
|
40
|
+
/** API exposed by PFrames library allowing to create and provide data for
|
|
41
|
+
* PFrame objects */
|
|
42
|
+
export interface PFrameFactoryAPIV3 extends Disposable {
|
|
43
|
+
/** Associates data source with this PFrame */
|
|
44
|
+
setDataSource(dataSource: PFrameDataSource): void;
|
|
45
|
+
/** Adds PColumn without data info */
|
|
46
|
+
addColumnSpec(columnId: PObjectId, columnSpec: PColumnSpec): void;
|
|
47
|
+
/**
|
|
48
|
+
* Assign data info to the specified PColumn.
|
|
49
|
+
* For parquet data info, schema resolution via network is performed during this call.
|
|
50
|
+
*/
|
|
51
|
+
setColumnData(columnId: PObjectId, dataInfo: DataInfo<PFrameBlobId>, options?: {
|
|
52
|
+
signal?: AbortSignal;
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
/** Releases all the data previously added to PFrame using methods above,
|
|
55
|
+
* any interactions with disposed PFrame will result in exception */
|
|
56
|
+
dispose(): void;
|
|
57
|
+
}
|
|
40
58
|
//# sourceMappingURL=api_factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_factory.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/api_factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,uBAAuB,EACvB,YAAY,EACZ,0BAA0B,EAC1B,WAAW,EACX,SAAS,EACV,MAAM,iCAAiC,CAAC;AAEzC,wFAAwF;AACxF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAGlC;+EAC+E;AAC/E,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,gGAAgG;AAChG,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD,qEAAqE;IACrE,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC/D,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,IACrB,YAAY,GACZ,uBAAuB,CAAC,IAAI,CAAC,GAC7B,yBAAyB,CAAC,IAAI,CAAC,GAC/B,0BAA0B,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AAEnD;oBACoB;AACpB,MAAM,WAAW,kBAAkB;IACjC,8CAA8C;IAC9C,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAElD,gCAAgC;IAChC,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAElE,gDAAgD;IAChD,aAAa,CACX,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAAC,EAChC,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GACA,OAAO,CA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AAI,CAAC,CAAC;IAEjB;wEACoE;IACpE,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;oBACoB;AACpB,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,8CAA8C;IAC9C,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAElD,qCAAqC;IACrC,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAElE;;;OAGG;IACH,aAAa,CACX,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAAC,EAChC,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GACA,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;wEACoE;IACpE,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
|
@@ -2,7 +2,7 @@ import { FindColumnsRequest, FindColumnsResponse } from './find_columns';
|
|
|
2
2
|
import { DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse } from './delete_column';
|
|
3
3
|
import { PColumnInfo, PColumnSpec, PObjectId, UniqueValuesRequest, UniqueValuesResponse } from '@milaboratories/pl-model-common';
|
|
4
4
|
import { CreateTableRequestV3 } from './create_table';
|
|
5
|
-
import { PTableV6 } from './table';
|
|
5
|
+
import { PTableV6, PTableV7 } from './table';
|
|
6
6
|
/** Read interface exposed by PFrames library */
|
|
7
7
|
export interface PFrameReadAPIV8 {
|
|
8
8
|
/**
|
|
@@ -27,4 +27,31 @@ export interface PFrameReadAPIV8 {
|
|
|
27
27
|
signal?: AbortSignal;
|
|
28
28
|
}): Promise<UniqueValuesResponse>;
|
|
29
29
|
}
|
|
30
|
+
/** Read interface exposed by PFrames library */
|
|
31
|
+
export interface PFrameReadAPIV9 {
|
|
32
|
+
/**
|
|
33
|
+
* Finds columns given filtering criteria on column name, annotations etc.
|
|
34
|
+
* and a set of qualified axes specs to find only columns with compatible
|
|
35
|
+
* axes spec.
|
|
36
|
+
*
|
|
37
|
+
* Only column specs are used, this method will work even for columns
|
|
38
|
+
* with no assigned data.
|
|
39
|
+
* */
|
|
40
|
+
findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Construct new axes integration with some entry removed but integration qualificaitons preserved.
|
|
43
|
+
* Removes more then one entry in case the removal will create several disjoint sets of axes.
|
|
44
|
+
*/
|
|
45
|
+
deleteColumn(request: DeleteColumnFromColumnsRequest): Promise<DeleteColumnFromColumnsResponse>;
|
|
46
|
+
/** Retrieve single column spec */
|
|
47
|
+
getColumnSpec(columnId: PObjectId): Promise<PColumnSpec>;
|
|
48
|
+
/** Retrieve information about all columns currently added to the PFrame */
|
|
49
|
+
listColumns(): Promise<PColumnInfo[]>;
|
|
50
|
+
/** Calculates data for the table and returns an object to access it */
|
|
51
|
+
createTable(request: CreateTableRequestV3): PTableV7;
|
|
52
|
+
/** Calculate set of unique values for a specific axis for the filtered set of records */
|
|
53
|
+
getUniqueValues(request: UniqueValuesRequest, ops?: {
|
|
54
|
+
signal?: AbortSignal;
|
|
55
|
+
}): Promise<UniqueValuesResponse>;
|
|
56
|
+
}
|
|
30
57
|
//# sourceMappingURL=api_read.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_read.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/api_read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,8BAA8B,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAClG,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
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AA8B,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAEhG,kCAAkC;IAClC,aAAa,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzD,2EAA2E;IAC3E,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAEtC,uEAAuE;IACvE,WAAW,CAAC,OAAO,EAAE,oBAAoB,GAAG,QAAQ,CAAC;IAErD,yFAAyF;IACzF,eAAe,CACb,OAAO,EAAE,mBAAmB,EAC5B,GAAG,CAAC,EAAE;QACJ,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GACA,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAClC"}
|
|
@@ -1,6 +1,30 @@
|
|
|
1
|
-
import type { PFrameFactoryAPIV2 } from './api_factory';
|
|
2
|
-
import type { PFrameReadAPIV8 } from './api_read';
|
|
1
|
+
import type { PFrameFactoryAPIV2, PFrameFactoryAPIV3 } from './api_factory';
|
|
2
|
+
import type { PFrameReadAPIV8, PFrameReadAPIV9 } from './api_read';
|
|
3
3
|
export type Logger = (level: 'info' | 'warn' | 'error', message: string) => void;
|
|
4
4
|
export interface PFrameV9 extends PFrameFactoryAPIV2, PFrameReadAPIV8 {
|
|
5
5
|
}
|
|
6
|
+
export interface PFrameV10 extends PFrameFactoryAPIV3, PFrameReadAPIV9 {
|
|
7
|
+
}
|
|
8
|
+
export type PFrameOptions = {
|
|
9
|
+
/** Path to directory where PFrame can create temporary files */
|
|
10
|
+
spillPath: string;
|
|
11
|
+
/** Logger instance, no logging is performed when not provided */
|
|
12
|
+
logger?: Logger;
|
|
13
|
+
};
|
|
14
|
+
/** List of PFrame management functions exposed by PFrame module */
|
|
15
|
+
export interface PFrameFactory {
|
|
16
|
+
/**
|
|
17
|
+
* Create a new PFrame instance.
|
|
18
|
+
* @warning Use concurrency limiting to avoid OOM crashes when multiple instances are simultaneously in use.
|
|
19
|
+
*/
|
|
20
|
+
createPFrame(options: PFrameOptions): PFrameV10;
|
|
21
|
+
/**
|
|
22
|
+
* Dump active allocations from all PFrames instances in pprof format.
|
|
23
|
+
* The result of this function should be saved as `profile.pb.gz`.
|
|
24
|
+
* Use {@link https://pprof.me/} or {@link https://www.speedscope.app/}
|
|
25
|
+
* to view the allocation flamechart.
|
|
26
|
+
* @warning This method will always reject on Windows!
|
|
27
|
+
*/
|
|
28
|
+
pprofDump: () => Promise<Uint8Array>;
|
|
29
|
+
}
|
|
6
30
|
//# sourceMappingURL=pframe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,MAAM,MAAM,GAAG,CACnB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,EAChC,OAAO,EAAE,MAAM,KACZ,IAAI,CAAC;AAEV,MAAM,WAAW,QAAS,SAAQ,kBAAkB,EAAE,eAAe;CAAG;AAExE,MAAM,WAAW,SAAU,SAAQ,kBAAkB,EAAE,eAAe;CAAG;AAEzE,MAAM,MAAM,aAAa,GAAG;IAC1B,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAA;AAED,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC;IAEhD;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACtC"}
|
|
@@ -53,4 +53,58 @@ export interface PTableV6 {
|
|
|
53
53
|
/** Deallocates all underlying resources */
|
|
54
54
|
dispose(): void;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Table view returned as a result of create table operation.
|
|
58
|
+
*
|
|
59
|
+
* PTable can be thought as having a composite primary key, consisting of axes,
|
|
60
|
+
* and a set of data columns derived from PColumn values.
|
|
61
|
+
* */
|
|
62
|
+
export interface PTableV7 extends Disposable {
|
|
63
|
+
/**
|
|
64
|
+
* Returns ordered array of table axes specs (primary key "columns" in SQL
|
|
65
|
+
* terms) and data column specs (regular "columns" in SQL terms).
|
|
66
|
+
*
|
|
67
|
+
* Data for a specific table column can be retrieved using unified indexing
|
|
68
|
+
* corresponding to elements in this array.
|
|
69
|
+
*
|
|
70
|
+
* Axes are always listed first.
|
|
71
|
+
* */
|
|
72
|
+
getSpec(): PTableColumnSpec[];
|
|
73
|
+
/** Transforms unified column identifiers into unified indices of columns. */
|
|
74
|
+
getColumnIndices(columnIds: PTableColumnId[]): number[];
|
|
75
|
+
/**
|
|
76
|
+
* Get PTable disk footprint in bytes
|
|
77
|
+
* Warning: This call materializes the join.
|
|
78
|
+
*/
|
|
79
|
+
getFootprint(ops?: {
|
|
80
|
+
withPredecessors?: boolean;
|
|
81
|
+
signal?: AbortSignal;
|
|
82
|
+
}): Promise<number>;
|
|
83
|
+
/**
|
|
84
|
+
* Unified table shape
|
|
85
|
+
* Warning: This call materializes the join.
|
|
86
|
+
*/
|
|
87
|
+
getShape(ops?: {
|
|
88
|
+
signal?: AbortSignal;
|
|
89
|
+
}): Promise<PTableShape>;
|
|
90
|
+
/**
|
|
91
|
+
* Retrieve the data from the table. To retrieve only data required, it can be
|
|
92
|
+
* sliced both horizontally ({@link columnIndices}) and vertically
|
|
93
|
+
* ({@link range}).
|
|
94
|
+
* This call materializes the join.
|
|
95
|
+
*
|
|
96
|
+
* @param columnIndices unified indices of columns to be retrieved
|
|
97
|
+
* @param range optionally limit the range of records to retrieve
|
|
98
|
+
* */
|
|
99
|
+
getData(columnIndices: number[], ops?: {
|
|
100
|
+
range?: TableRange;
|
|
101
|
+
signal?: AbortSignal;
|
|
102
|
+
}): Promise<PTableVector[]>;
|
|
103
|
+
/** Filters the table and returns new PTable instance */
|
|
104
|
+
filter(request: PTableRecordFilter[]): PTableV7;
|
|
105
|
+
/** Sorts the table and returns new PTable instance. */
|
|
106
|
+
sort(request: PTableSorting[]): PTableV7;
|
|
107
|
+
/** Deallocates all underlying resources */
|
|
108
|
+
dispose(): void;
|
|
109
|
+
}
|
|
56
110
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/table.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,UAAU,EACX,MAAM,iCAAiC,CAAC;AAEzC;;;;;KAKK;AACL,MAAM,WAAW,QAAQ;IACvB;;;;;;;;SAQK;IACL,OAAO,IAAI,gBAAgB,EAAE,CAAC;IAE9B,6EAA6E;IAC7E,gBAAgB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC;IAExD;;;OAGG;IACH,YAAY,CAAC,GAAG,CAAC,EAAE;QACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzB;;;;;;;;SAQK;IACL,OAAO,CACL,aAAa,EAAE,MAAM,EAAE,EACvB,GAAG,CAAC,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
|
|
3
|
+
"version": "1.8.13",
|
|
4
4
|
"description": "Common model between middle layer and non-block UI code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"remeda": "^2.28.0",
|
|
21
21
|
"zod": "~3.23.8",
|
|
22
22
|
"utility-types": "^3.11.0",
|
|
23
|
-
"@milaboratories/pl-model-common": "
|
|
23
|
+
"@milaboratories/pl-model-common": "1.19.13"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"typescript": "~5.6.3",
|
|
27
|
-
"@milaboratories/
|
|
27
|
+
"@milaboratories/build-configs": "1.0.8",
|
|
28
28
|
"@milaboratories/ts-configs": "1.0.6",
|
|
29
|
-
"@milaboratories/
|
|
29
|
+
"@milaboratories/ts-builder": "1.0.5"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"type-check": "ts-builder types --target node",
|
|
@@ -63,3 +63,29 @@ export interface PFrameFactoryAPIV2 {
|
|
|
63
63
|
* any interactions with disposed PFrame will result in exception */
|
|
64
64
|
dispose(): void;
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
/** API exposed by PFrames library allowing to create and provide data for
|
|
68
|
+
* PFrame objects */
|
|
69
|
+
export interface PFrameFactoryAPIV3 extends Disposable {
|
|
70
|
+
/** Associates data source with this PFrame */
|
|
71
|
+
setDataSource(dataSource: PFrameDataSource): void;
|
|
72
|
+
|
|
73
|
+
/** Adds PColumn without data info */
|
|
74
|
+
addColumnSpec(columnId: PObjectId, columnSpec: PColumnSpec): void;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Assign data info to the specified PColumn.
|
|
78
|
+
* For parquet data info, schema resolution via network is performed during this call.
|
|
79
|
+
*/
|
|
80
|
+
setColumnData(
|
|
81
|
+
columnId: PObjectId,
|
|
82
|
+
dataInfo: DataInfo<PFrameBlobId>,
|
|
83
|
+
options?: {
|
|
84
|
+
signal?: AbortSignal,
|
|
85
|
+
}
|
|
86
|
+
): Promise<void>;
|
|
87
|
+
|
|
88
|
+
/** Releases all the data previously added to PFrame using methods above,
|
|
89
|
+
* any interactions with disposed PFrame will result in exception */
|
|
90
|
+
dispose(): void;
|
|
91
|
+
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
UniqueValuesResponse
|
|
9
9
|
} from '@milaboratories/pl-model-common';
|
|
10
10
|
import { CreateTableRequestV3 } from './create_table';
|
|
11
|
-
import { PTableV6 } from './table';
|
|
11
|
+
import { PTableV6, PTableV7 } from './table';
|
|
12
12
|
|
|
13
13
|
/** Read interface exposed by PFrames library */
|
|
14
14
|
export interface PFrameReadAPIV8 {
|
|
@@ -42,3 +42,39 @@ export interface PFrameReadAPIV8 {
|
|
|
42
42
|
}
|
|
43
43
|
): Promise<UniqueValuesResponse>;
|
|
44
44
|
}
|
|
45
|
+
|
|
46
|
+
/** Read interface exposed by PFrames library */
|
|
47
|
+
export interface PFrameReadAPIV9 {
|
|
48
|
+
/**
|
|
49
|
+
* Finds columns given filtering criteria on column name, annotations etc.
|
|
50
|
+
* and a set of qualified axes specs to find only columns with compatible
|
|
51
|
+
* axes spec.
|
|
52
|
+
*
|
|
53
|
+
* Only column specs are used, this method will work even for columns
|
|
54
|
+
* with no assigned data.
|
|
55
|
+
* */
|
|
56
|
+
findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Construct new axes integration with some entry removed but integration qualificaitons preserved.
|
|
60
|
+
* Removes more then one entry in case the removal will create several disjoint sets of axes.
|
|
61
|
+
*/
|
|
62
|
+
deleteColumn(request: DeleteColumnFromColumnsRequest): Promise<DeleteColumnFromColumnsResponse>;
|
|
63
|
+
|
|
64
|
+
/** Retrieve single column spec */
|
|
65
|
+
getColumnSpec(columnId: PObjectId): Promise<PColumnSpec>;
|
|
66
|
+
|
|
67
|
+
/** Retrieve information about all columns currently added to the PFrame */
|
|
68
|
+
listColumns(): Promise<PColumnInfo[]>;
|
|
69
|
+
|
|
70
|
+
/** Calculates data for the table and returns an object to access it */
|
|
71
|
+
createTable(request: CreateTableRequestV3): PTableV7;
|
|
72
|
+
|
|
73
|
+
/** Calculate set of unique values for a specific axis for the filtered set of records */
|
|
74
|
+
getUniqueValues(
|
|
75
|
+
request: UniqueValuesRequest,
|
|
76
|
+
ops?: {
|
|
77
|
+
signal?: AbortSignal,
|
|
78
|
+
}
|
|
79
|
+
): Promise<UniqueValuesResponse>;
|
|
80
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PFrameFactoryAPIV2 } from './api_factory';
|
|
2
|
-
import type { PFrameReadAPIV8 } from './api_read';
|
|
1
|
+
import type { PFrameFactoryAPIV2, PFrameFactoryAPIV3 } from './api_factory';
|
|
2
|
+
import type { PFrameReadAPIV8, PFrameReadAPIV9 } from './api_read';
|
|
3
3
|
|
|
4
4
|
export type Logger = (
|
|
5
5
|
level: 'info' | 'warn' | 'error',
|
|
@@ -7,3 +7,30 @@ export type Logger = (
|
|
|
7
7
|
) => void;
|
|
8
8
|
|
|
9
9
|
export interface PFrameV9 extends PFrameFactoryAPIV2, PFrameReadAPIV8 {}
|
|
10
|
+
|
|
11
|
+
export interface PFrameV10 extends PFrameFactoryAPIV3, PFrameReadAPIV9 {}
|
|
12
|
+
|
|
13
|
+
export type PFrameOptions = {
|
|
14
|
+
/** Path to directory where PFrame can create temporary files */
|
|
15
|
+
spillPath: string;
|
|
16
|
+
/** Logger instance, no logging is performed when not provided */
|
|
17
|
+
logger?: Logger;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** List of PFrame management functions exposed by PFrame module */
|
|
21
|
+
export interface PFrameFactory {
|
|
22
|
+
/**
|
|
23
|
+
* Create a new PFrame instance.
|
|
24
|
+
* @warning Use concurrency limiting to avoid OOM crashes when multiple instances are simultaneously in use.
|
|
25
|
+
*/
|
|
26
|
+
createPFrame(options: PFrameOptions): PFrameV10;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Dump active allocations from all PFrames instances in pprof format.
|
|
30
|
+
* The result of this function should be saved as `profile.pb.gz`.
|
|
31
|
+
* Use {@link https://pprof.me/} or {@link https://www.speedscope.app/}
|
|
32
|
+
* to view the allocation flamechart.
|
|
33
|
+
* @warning This method will always reject on Windows!
|
|
34
|
+
*/
|
|
35
|
+
pprofDump: () => Promise<Uint8Array>;
|
|
36
|
+
};
|
|
@@ -72,3 +72,68 @@ export interface PTableV6 {
|
|
|
72
72
|
/** Deallocates all underlying resources */
|
|
73
73
|
dispose(): void;
|
|
74
74
|
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Table view returned as a result of create table operation.
|
|
78
|
+
*
|
|
79
|
+
* PTable can be thought as having a composite primary key, consisting of axes,
|
|
80
|
+
* and a set of data columns derived from PColumn values.
|
|
81
|
+
* */
|
|
82
|
+
export interface PTableV7 extends Disposable {
|
|
83
|
+
/**
|
|
84
|
+
* Returns ordered array of table axes specs (primary key "columns" in SQL
|
|
85
|
+
* terms) and data column specs (regular "columns" in SQL terms).
|
|
86
|
+
*
|
|
87
|
+
* Data for a specific table column can be retrieved using unified indexing
|
|
88
|
+
* corresponding to elements in this array.
|
|
89
|
+
*
|
|
90
|
+
* Axes are always listed first.
|
|
91
|
+
* */
|
|
92
|
+
getSpec(): PTableColumnSpec[];
|
|
93
|
+
|
|
94
|
+
/** Transforms unified column identifiers into unified indices of columns. */
|
|
95
|
+
getColumnIndices(columnIds: PTableColumnId[]): number[];
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Get PTable disk footprint in bytes
|
|
99
|
+
* Warning: This call materializes the join.
|
|
100
|
+
*/
|
|
101
|
+
getFootprint(ops?: {
|
|
102
|
+
withPredecessors?: boolean,
|
|
103
|
+
signal?: AbortSignal,
|
|
104
|
+
}): Promise<number>;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Unified table shape
|
|
108
|
+
* Warning: This call materializes the join.
|
|
109
|
+
*/
|
|
110
|
+
getShape(ops?: {
|
|
111
|
+
signal?: AbortSignal,
|
|
112
|
+
}): Promise<PTableShape>;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Retrieve the data from the table. To retrieve only data required, it can be
|
|
116
|
+
* sliced both horizontally ({@link columnIndices}) and vertically
|
|
117
|
+
* ({@link range}).
|
|
118
|
+
* This call materializes the join.
|
|
119
|
+
*
|
|
120
|
+
* @param columnIndices unified indices of columns to be retrieved
|
|
121
|
+
* @param range optionally limit the range of records to retrieve
|
|
122
|
+
* */
|
|
123
|
+
getData(
|
|
124
|
+
columnIndices: number[],
|
|
125
|
+
ops?: {
|
|
126
|
+
range?: TableRange,
|
|
127
|
+
signal?: AbortSignal,
|
|
128
|
+
},
|
|
129
|
+
): Promise<PTableVector[]>;
|
|
130
|
+
|
|
131
|
+
/** Filters the table and returns new PTable instance */
|
|
132
|
+
filter(request: PTableRecordFilter[]): PTableV7;
|
|
133
|
+
|
|
134
|
+
/** Sorts the table and returns new PTable instance. */
|
|
135
|
+
sort(request: PTableSorting[]): PTableV7;
|
|
136
|
+
|
|
137
|
+
/** Deallocates all underlying resources */
|
|
138
|
+
dispose(): void;
|
|
139
|
+
}
|