@milaboratories/pl-model-middle-layer 1.20.0 → 1.21.0
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/block_meta/block_components.d.ts +69 -69
- package/dist/block_meta/block_description.d.ts +418 -418
- package/dist/block_meta/block_id.d.ts +4 -4
- package/dist/block_meta/block_manifest.d.ts +336 -336
- package/dist/block_meta/block_meta.d.ts +138 -138
- package/dist/block_meta/content_types.d.ts +29 -29
- package/dist/block_registry/block_pack_spec.d.ts +24 -24
- package/dist/block_registry/overview.d.ts +1716 -1716
- package/dist/block_registry/registry_spec.d.ts +12 -12
- package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
- package/dist/pframe/internal_api/api_factory.d.ts +36 -2
- package/dist/pframe/internal_api/api_factory.d.ts.map +1 -1
- package/dist/pframe/internal_api/api_factory.js.map +1 -1
- package/dist/pframe/internal_api/api_read.d.ts +40 -3
- package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
- package/dist/pframe/internal_api/index.d.ts +5 -5
- package/dist/pframe/internal_api/pframe.d.ts +21 -3
- package/dist/pframe/internal_api/pframe.d.ts.map +1 -1
- package/dist/pframe/internal_api/table.d.ts +51 -1
- package/dist/pframe/internal_api/table.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/pframe/internal_api/api_factory.ts +44 -0
- package/src/pframe/internal_api/api_read.ts +48 -1
- package/src/pframe/internal_api/pframe.ts +23 -2
- package/src/pframe/internal_api/table.ts +54 -0
|
@@ -99,27 +99,27 @@ declare const RegistryEntry: z.ZodObject<{
|
|
|
99
99
|
}, "strip", z.ZodTypeAny, {
|
|
100
100
|
id: string;
|
|
101
101
|
spec: {
|
|
102
|
-
type: "local-dev";
|
|
103
|
-
path: string;
|
|
104
|
-
} | {
|
|
105
102
|
type: "remote-v1";
|
|
106
103
|
url: string;
|
|
107
104
|
} | {
|
|
108
105
|
type: "remote-v2";
|
|
109
106
|
url: string;
|
|
107
|
+
} | {
|
|
108
|
+
type: "local-dev";
|
|
109
|
+
path: string;
|
|
110
110
|
};
|
|
111
111
|
title?: string | undefined;
|
|
112
112
|
}, {
|
|
113
113
|
id: string;
|
|
114
114
|
spec: {
|
|
115
|
-
type: "local-dev";
|
|
116
|
-
path: string;
|
|
117
|
-
} | {
|
|
118
115
|
type: "remote-v1";
|
|
119
116
|
url: string;
|
|
120
117
|
} | {
|
|
121
118
|
type: "remote-v2";
|
|
122
119
|
url: string;
|
|
120
|
+
} | {
|
|
121
|
+
type: "local-dev";
|
|
122
|
+
path: string;
|
|
123
123
|
};
|
|
124
124
|
title?: string | undefined;
|
|
125
125
|
}>;
|
|
@@ -158,27 +158,27 @@ declare const RegistryList: z.ZodArray<z.ZodObject<{
|
|
|
158
158
|
}, "strip", z.ZodTypeAny, {
|
|
159
159
|
id: string;
|
|
160
160
|
spec: {
|
|
161
|
-
type: "local-dev";
|
|
162
|
-
path: string;
|
|
163
|
-
} | {
|
|
164
161
|
type: "remote-v1";
|
|
165
162
|
url: string;
|
|
166
163
|
} | {
|
|
167
164
|
type: "remote-v2";
|
|
168
165
|
url: string;
|
|
166
|
+
} | {
|
|
167
|
+
type: "local-dev";
|
|
168
|
+
path: string;
|
|
169
169
|
};
|
|
170
170
|
title?: string | undefined;
|
|
171
171
|
}, {
|
|
172
172
|
id: string;
|
|
173
173
|
spec: {
|
|
174
|
-
type: "local-dev";
|
|
175
|
-
path: string;
|
|
176
|
-
} | {
|
|
177
174
|
type: "remote-v1";
|
|
178
175
|
url: string;
|
|
179
176
|
} | {
|
|
180
177
|
type: "remote-v2";
|
|
181
178
|
url: string;
|
|
179
|
+
} | {
|
|
180
|
+
type: "local-dev";
|
|
181
|
+
path: string;
|
|
182
182
|
};
|
|
183
183
|
title?: string | undefined;
|
|
184
184
|
}>, "many">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_factory.cjs","names":[],"sources":["../../../src/pframe/internal_api/api_factory.ts"],"sourcesContent":["import type {\n BinaryPartitionedDataInfo,\n Branded,\n JsonDataInfo,\n JsonPartitionedDataInfo,\n ParquetChunk,\n ParquetPartitionedDataInfo,\n PColumnSpec,\n PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport type { HttpServerInfo } from \"./http_helpers\";\n\n/** PColumn spec file extension */\nexport const SpecExtension = \".spec\" as const;\n\n/** PColumn data info file extension */\nexport const DataInfoExtension = \".datainfo\" as const;\n\n/** Abstract identifier of a data blob that can be requested from the storage backend */\nexport type PFrameBlobId = Branded<string, \"PFrameInternal.PFrameBlobId\">;\n\n/** Path of the file containing requested data (blob). This path is returned by\n * {@link BlobPathResolver} as soon as blob materialized in the file system. */\nexport type FilePath = string;\n\n/** Data source allows PFrame to retrieve the data blobs for columns with assigned data info. */\nexport interface PFrameDataSourceV2 {\n /**\n * PFrame may notify storage backend about its plans to use particular blobs in the future.\n * Storage backend will do its best to preload specified blob so the subsequent\n * {@link resolveBlob} will quickly return preloaded file path.\n */\n preloadBlob(blobIds: PFrameBlobId[]): Promise<void>;\n\n /** Returns raw blob data given the blob id from {@link DataInfo}. */\n resolveBlobContent(blobId: PFrameBlobId): Promise<Uint8Array>;\n\n /**\n * Parquet HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer}\n * When not provided, parquet BlobIds would be treated as local file paths.\n */\n parquetServer?: HttpServerInfo;\n}\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<ParquetChunk<Blob>>;\n\n/** API exposed by PFrames library allowing to create and provide data for\n * PFrame objects */\nexport interface PFrameFactoryAPIV4 extends Disposable {\n /** Associates data source with this PFrame */\n setDataSource(dataSource: PFrameDataSourceV2): void;\n\n /** Adds PColumn without data info */\n addColumnSpec(columnId: PObjectId, columnSpec: PColumnSpec): void;\n\n /**\n * Assign data info to the specified PColumn.\n * For parquet data info, schema resolution via network is performed during this call.\n */\n setColumnData(\n columnId: PObjectId,\n dataInfo: DataInfo<PFrameBlobId>,\n options?: {\n signal?: AbortSignal;\n },\n ): Promise<void>;\n\n /** Releases all the data previously added to PFrame using methods above,\n * any interactions with disposed PFrame will result in exception */\n dispose(): void;\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"api_factory.cjs","names":[],"sources":["../../../src/pframe/internal_api/api_factory.ts"],"sourcesContent":["import type {\n AxisValueType,\n BinaryPartitionedDataInfo,\n Branded,\n ColumnValueType,\n JsonDataInfo,\n JsonPartitionedDataInfo,\n ParquetChunk,\n ParquetPartitionedDataInfo,\n PColumnSpec,\n PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport type { HttpServerInfo } from \"./http_helpers\";\n\n/** PColumn spec file extension */\nexport const SpecExtension = \".spec\" as const;\n\n/** PColumn data info file extension */\nexport const DataInfoExtension = \".datainfo\" as const;\n\n/** Abstract identifier of a data blob that can be requested from the storage backend */\nexport type PFrameBlobId = Branded<string, \"PFrameInternal.PFrameBlobId\">;\n\n/** Path of the file containing requested data (blob). This path is returned by\n * {@link BlobPathResolver} as soon as blob materialized in the file system. */\nexport type FilePath = string;\n\n/** Data source allows PFrame to retrieve the data blobs for columns with assigned data info. */\nexport interface PFrameDataSourceV2 {\n /**\n * PFrame may notify storage backend about its plans to use particular blobs in the future.\n * Storage backend will do its best to preload specified blob so the subsequent\n * {@link resolveBlob} will quickly return preloaded file path.\n */\n preloadBlob(blobIds: PFrameBlobId[]): Promise<void>;\n\n /** Returns raw blob data given the blob id from {@link DataInfo}. */\n resolveBlobContent(blobId: PFrameBlobId): Promise<Uint8Array>;\n\n /**\n * Parquet HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer}\n * When not provided, parquet BlobIds would be treated as local file paths.\n */\n parquetServer?: HttpServerInfo;\n}\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<ParquetChunk<Blob>>;\n\n/** API exposed by PFrames library allowing to create and provide data for\n * PFrame objects */\nexport interface PFrameFactoryAPIV4 extends Disposable {\n /** Associates data source with this PFrame */\n setDataSource(dataSource: PFrameDataSourceV2): void;\n\n /** Adds PColumn without data info */\n addColumnSpec(columnId: PObjectId, columnSpec: PColumnSpec): void;\n\n /**\n * Assign data info to the specified PColumn.\n * For parquet data info, schema resolution via network is performed during this call.\n */\n setColumnData(\n columnId: PObjectId,\n dataInfo: DataInfo<PFrameBlobId>,\n options?: {\n signal?: AbortSignal;\n },\n ): Promise<void>;\n\n /** Releases all the data previously added to PFrame using methods above,\n * any interactions with disposed PFrame will result in exception */\n dispose(): void;\n}\n\n/**\n * Structural type information needed by the data side: axis value\n * types and column value types, in their canonical order. Mirrors\n * the bridge-side `TypeSpec`.\n */\nexport interface PColumnValueTypeSpec {\n readonly axes: AxisValueType[];\n readonly columns: ColumnValueType[];\n}\n\n/** Single column entry for {@link PFrameFactoryAPIV5.addColumns}. */\nexport interface AddColumnEntry {\n /** Unique column identifier within the PFrame. */\n readonly id: PObjectId;\n /** Structural type info (axes / column value types). */\n readonly typeSpec: PColumnValueTypeSpec;\n /** Data info for the column. */\n readonly data: DataInfo<PFrameBlobId>;\n}\n\n/** API for populating a PFrame with columns and a data source. */\nexport interface PFrameFactoryAPIV5 extends Disposable {\n /** Associates data source with this PFrame. */\n setDataSource(dataSource: PFrameDataSourceV2): void;\n\n /**\n * Registers all PColumns at once: specs are recorded and data info\n * is attached atomically. For parquet data info, schema resolution\n * via network is performed during this call.\n */\n addColumns(\n columns: AddColumnEntry[],\n options?: {\n signal?: AbortSignal;\n },\n ): Promise<void>;\n\n /** Releases all the data previously added to PFrame using methods above,\n * any interactions with disposed PFrame will result in exception */\n dispose(): void;\n}\n"],"mappings":";;AAeA,MAAa,gBAAgB;;AAG7B,MAAa,oBAAoB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpServerInfo } from "./http_helpers.js";
|
|
2
|
-
import { BinaryPartitionedDataInfo, Branded, JsonDataInfo, JsonPartitionedDataInfo, PColumnSpec, PObjectId, ParquetChunk, ParquetPartitionedDataInfo } from "@milaboratories/pl-model-common";
|
|
2
|
+
import { AxisValueType, BinaryPartitionedDataInfo, Branded, ColumnValueType, JsonDataInfo, JsonPartitionedDataInfo, PColumnSpec, PObjectId, ParquetChunk, ParquetPartitionedDataInfo } from "@milaboratories/pl-model-common";
|
|
3
3
|
|
|
4
4
|
//#region src/pframe/internal_api/api_factory.d.ts
|
|
5
5
|
/** PColumn spec file extension */
|
|
@@ -52,6 +52,40 @@ interface PFrameFactoryAPIV4 extends Disposable {
|
|
|
52
52
|
* any interactions with disposed PFrame will result in exception */
|
|
53
53
|
dispose(): void;
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Structural type information needed by the data side: axis value
|
|
57
|
+
* types and column value types, in their canonical order. Mirrors
|
|
58
|
+
* the bridge-side `TypeSpec`.
|
|
59
|
+
*/
|
|
60
|
+
interface PColumnValueTypeSpec {
|
|
61
|
+
readonly axes: AxisValueType[];
|
|
62
|
+
readonly columns: ColumnValueType[];
|
|
63
|
+
}
|
|
64
|
+
/** Single column entry for {@link PFrameFactoryAPIV5.addColumns}. */
|
|
65
|
+
interface AddColumnEntry {
|
|
66
|
+
/** Unique column identifier within the PFrame. */
|
|
67
|
+
readonly id: PObjectId;
|
|
68
|
+
/** Structural type info (axes / column value types). */
|
|
69
|
+
readonly typeSpec: PColumnValueTypeSpec;
|
|
70
|
+
/** Data info for the column. */
|
|
71
|
+
readonly data: DataInfo<PFrameBlobId>;
|
|
72
|
+
}
|
|
73
|
+
/** API for populating a PFrame with columns and a data source. */
|
|
74
|
+
interface PFrameFactoryAPIV5 extends Disposable {
|
|
75
|
+
/** Associates data source with this PFrame. */
|
|
76
|
+
setDataSource(dataSource: PFrameDataSourceV2): void;
|
|
77
|
+
/**
|
|
78
|
+
* Registers all PColumns at once: specs are recorded and data info
|
|
79
|
+
* is attached atomically. For parquet data info, schema resolution
|
|
80
|
+
* via network is performed during this call.
|
|
81
|
+
*/
|
|
82
|
+
addColumns(columns: AddColumnEntry[], options?: {
|
|
83
|
+
signal?: AbortSignal;
|
|
84
|
+
}): Promise<void>;
|
|
85
|
+
/** Releases all the data previously added to PFrame using methods above,
|
|
86
|
+
* any interactions with disposed PFrame will result in exception */
|
|
87
|
+
dispose(): void;
|
|
88
|
+
}
|
|
55
89
|
//#endregion
|
|
56
|
-
export { DataInfo, DataInfoExtension, FilePath, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV4, SpecExtension };
|
|
90
|
+
export { AddColumnEntry, DataInfo, DataInfoExtension, FilePath, PColumnValueTypeSpec, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV4, PFrameFactoryAPIV5, SpecExtension };
|
|
57
91
|
//# sourceMappingURL=api_factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_factory.d.ts","names":[],"sources":["../../../src/pframe/internal_api/api_factory.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"api_factory.d.ts","names":[],"sources":["../../../src/pframe/internal_api/api_factory.ts"],"mappings":";;;;;cAea,aAAA;AAAb;AAAA,cAGa,iBAAA;;KAGD,YAAA,GAAe,OAAA;;AAH3B;KAOY,QAAA;;UAGK,kBAAA;EAVoC;AAGrD;;;;EAaE,WAAA,CAAY,OAAA,EAAS,YAAA,KAAiB,OAAA;EAT5B;EAYV,kBAAA,CAAmB,MAAA,EAAQ,YAAA,GAAe,OAAA,CAAQ,UAAA;;;;AATpD;EAeE,aAAA,GAAgB,cAAA;AAAA;;;;;;;KASN,QAAA,SACR,YAAA,GACA,uBAAA,CAAwB,IAAA,IACxB,yBAAA,CAA0B,IAAA,IAC1B,0BAAA,CAA2B,YAAA,CAAa,IAAA;;;UAI3B,kBAAA,SAA2B,UAAA;EA1B9B;EA4BZ,aAAA,CAAc,UAAA,EAAY,kBAAA;EAzB1B;EA4BA,aAAA,CAAc,QAAA,EAAU,SAAA,EAAW,UAAA,EAAY,WAAA;EA5B5B;;;;EAkCnB,aAAA,CACE,QAAA,EAAU,SAAA,EACV,QAAA,EAAU,QAAA,CAAS,YAAA,GACnB,OAAA;IACE,MAAA,GAAS,WAAA;EAAA,IAEV,OAAA;EAzBO;;EA6BV,OAAA;AAAA;;;;;;UAQe,oBAAA;EAAA,SACN,IAAA,EAAM,aAAA;EAAA,SACN,OAAA,EAAS,eAAA;AAAA;;UAIH,cAAA;EAzCb;EAAA,SA2CO,EAAA,EAAI,SAAA;EA1CX;EAAA,SA4CO,QAAA,EAAU,oBAAA;EA3CjB;EAAA,SA6CO,IAAA,EAAM,QAAA,CAAS,YAAA;AAAA;;UAIT,kBAAA,SAA2B,UAAA;EA7C3B;EA+Cf,aAAA,CAAc,UAAA,EAAY,kBAAA;;;;;;EAO1B,UAAA,CACE,OAAA,EAAS,cAAA,IACT,OAAA;IACE,MAAA,GAAS,WAAA;EAAA,IAEV,OAAA;EA1CA;;EA8CH,OAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_factory.js","names":[],"sources":["../../../src/pframe/internal_api/api_factory.ts"],"sourcesContent":["import type {\n BinaryPartitionedDataInfo,\n Branded,\n JsonDataInfo,\n JsonPartitionedDataInfo,\n ParquetChunk,\n ParquetPartitionedDataInfo,\n PColumnSpec,\n PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport type { HttpServerInfo } from \"./http_helpers\";\n\n/** PColumn spec file extension */\nexport const SpecExtension = \".spec\" as const;\n\n/** PColumn data info file extension */\nexport const DataInfoExtension = \".datainfo\" as const;\n\n/** Abstract identifier of a data blob that can be requested from the storage backend */\nexport type PFrameBlobId = Branded<string, \"PFrameInternal.PFrameBlobId\">;\n\n/** Path of the file containing requested data (blob). This path is returned by\n * {@link BlobPathResolver} as soon as blob materialized in the file system. */\nexport type FilePath = string;\n\n/** Data source allows PFrame to retrieve the data blobs for columns with assigned data info. */\nexport interface PFrameDataSourceV2 {\n /**\n * PFrame may notify storage backend about its plans to use particular blobs in the future.\n * Storage backend will do its best to preload specified blob so the subsequent\n * {@link resolveBlob} will quickly return preloaded file path.\n */\n preloadBlob(blobIds: PFrameBlobId[]): Promise<void>;\n\n /** Returns raw blob data given the blob id from {@link DataInfo}. */\n resolveBlobContent(blobId: PFrameBlobId): Promise<Uint8Array>;\n\n /**\n * Parquet HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer}\n * When not provided, parquet BlobIds would be treated as local file paths.\n */\n parquetServer?: HttpServerInfo;\n}\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<ParquetChunk<Blob>>;\n\n/** API exposed by PFrames library allowing to create and provide data for\n * PFrame objects */\nexport interface PFrameFactoryAPIV4 extends Disposable {\n /** Associates data source with this PFrame */\n setDataSource(dataSource: PFrameDataSourceV2): void;\n\n /** Adds PColumn without data info */\n addColumnSpec(columnId: PObjectId, columnSpec: PColumnSpec): void;\n\n /**\n * Assign data info to the specified PColumn.\n * For parquet data info, schema resolution via network is performed during this call.\n */\n setColumnData(\n columnId: PObjectId,\n dataInfo: DataInfo<PFrameBlobId>,\n options?: {\n signal?: AbortSignal;\n },\n ): Promise<void>;\n\n /** Releases all the data previously added to PFrame using methods above,\n * any interactions with disposed PFrame will result in exception */\n dispose(): void;\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"api_factory.js","names":[],"sources":["../../../src/pframe/internal_api/api_factory.ts"],"sourcesContent":["import type {\n AxisValueType,\n BinaryPartitionedDataInfo,\n Branded,\n ColumnValueType,\n JsonDataInfo,\n JsonPartitionedDataInfo,\n ParquetChunk,\n ParquetPartitionedDataInfo,\n PColumnSpec,\n PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport type { HttpServerInfo } from \"./http_helpers\";\n\n/** PColumn spec file extension */\nexport const SpecExtension = \".spec\" as const;\n\n/** PColumn data info file extension */\nexport const DataInfoExtension = \".datainfo\" as const;\n\n/** Abstract identifier of a data blob that can be requested from the storage backend */\nexport type PFrameBlobId = Branded<string, \"PFrameInternal.PFrameBlobId\">;\n\n/** Path of the file containing requested data (blob). This path is returned by\n * {@link BlobPathResolver} as soon as blob materialized in the file system. */\nexport type FilePath = string;\n\n/** Data source allows PFrame to retrieve the data blobs for columns with assigned data info. */\nexport interface PFrameDataSourceV2 {\n /**\n * PFrame may notify storage backend about its plans to use particular blobs in the future.\n * Storage backend will do its best to preload specified blob so the subsequent\n * {@link resolveBlob} will quickly return preloaded file path.\n */\n preloadBlob(blobIds: PFrameBlobId[]): Promise<void>;\n\n /** Returns raw blob data given the blob id from {@link DataInfo}. */\n resolveBlobContent(blobId: PFrameBlobId): Promise<Uint8Array>;\n\n /**\n * Parquet HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer}\n * When not provided, parquet BlobIds would be treated as local file paths.\n */\n parquetServer?: HttpServerInfo;\n}\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<ParquetChunk<Blob>>;\n\n/** API exposed by PFrames library allowing to create and provide data for\n * PFrame objects */\nexport interface PFrameFactoryAPIV4 extends Disposable {\n /** Associates data source with this PFrame */\n setDataSource(dataSource: PFrameDataSourceV2): void;\n\n /** Adds PColumn without data info */\n addColumnSpec(columnId: PObjectId, columnSpec: PColumnSpec): void;\n\n /**\n * Assign data info to the specified PColumn.\n * For parquet data info, schema resolution via network is performed during this call.\n */\n setColumnData(\n columnId: PObjectId,\n dataInfo: DataInfo<PFrameBlobId>,\n options?: {\n signal?: AbortSignal;\n },\n ): Promise<void>;\n\n /** Releases all the data previously added to PFrame using methods above,\n * any interactions with disposed PFrame will result in exception */\n dispose(): void;\n}\n\n/**\n * Structural type information needed by the data side: axis value\n * types and column value types, in their canonical order. Mirrors\n * the bridge-side `TypeSpec`.\n */\nexport interface PColumnValueTypeSpec {\n readonly axes: AxisValueType[];\n readonly columns: ColumnValueType[];\n}\n\n/** Single column entry for {@link PFrameFactoryAPIV5.addColumns}. */\nexport interface AddColumnEntry {\n /** Unique column identifier within the PFrame. */\n readonly id: PObjectId;\n /** Structural type info (axes / column value types). */\n readonly typeSpec: PColumnValueTypeSpec;\n /** Data info for the column. */\n readonly data: DataInfo<PFrameBlobId>;\n}\n\n/** API for populating a PFrame with columns and a data source. */\nexport interface PFrameFactoryAPIV5 extends Disposable {\n /** Associates data source with this PFrame. */\n setDataSource(dataSource: PFrameDataSourceV2): void;\n\n /**\n * Registers all PColumns at once: specs are recorded and data info\n * is attached atomically. For parquet data info, schema resolution\n * via network is performed during this call.\n */\n addColumns(\n columns: AddColumnEntry[],\n options?: {\n signal?: AbortSignal;\n },\n ): Promise<void>;\n\n /** Releases all the data previously added to PFrame using methods above,\n * any interactions with disposed PFrame will result in exception */\n dispose(): void;\n}\n"],"mappings":";;AAeA,MAAa,gBAAgB;;AAG7B,MAAa,oBAAoB"}
|
|
@@ -2,8 +2,8 @@ import { PTableId } from "./common.js";
|
|
|
2
2
|
import { FindColumnsRequest, FindColumnsResponse } from "./find_columns.js";
|
|
3
3
|
import { DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse } from "./delete_column.js";
|
|
4
4
|
import { CreateTableRequestV4 } from "./create_table.js";
|
|
5
|
-
import { PTableV8 } from "./table.js";
|
|
6
|
-
import { DataQuery, PColumnInfo, PColumnSpec, PObjectId, PTableColumnSpec, UniqueValuesRequest, UniqueValuesResponse } from "@milaboratories/pl-model-common";
|
|
5
|
+
import { PTableV8, PTableV9 } from "./table.js";
|
|
6
|
+
import { DataQuery, DataQueryBooleanExpression, PColumnInfo, PColumnSpec, PObjectId, PTableColumnSpec, UniqueValuesRequest, UniqueValuesResponse } from "@milaboratories/pl-model-common";
|
|
7
7
|
|
|
8
8
|
//#region src/pframe/internal_api/api_read.d.ts
|
|
9
9
|
/** Read interface exposed by PFrames library */
|
|
@@ -38,6 +38,43 @@ interface PFrameReadAPIV11 {
|
|
|
38
38
|
signal?: AbortSignal;
|
|
39
39
|
}): Promise<UniqueValuesResponse>;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* V2 unique-values request. Axis and filter references are
|
|
43
|
+
* pre-resolved to numeric indices; no selector ids cross the API
|
|
44
|
+
* boundary. Each filter is a boolean predicate that must evaluate to
|
|
45
|
+
* true for the row to be included.
|
|
46
|
+
*/
|
|
47
|
+
interface UniqueValuesRequestV2 {
|
|
48
|
+
/** Target column. */
|
|
49
|
+
readonly columnId: PObjectId;
|
|
50
|
+
/**
|
|
51
|
+
* Target axis (pre-resolved index into the column's axes).
|
|
52
|
+
* When omitted, unique values are collected from the column itself.
|
|
53
|
+
*/
|
|
54
|
+
readonly axisIndex?: number;
|
|
55
|
+
/** Pre-resolved boolean predicates applied before collecting values. */
|
|
56
|
+
readonly filters: DataQueryBooleanExpression[];
|
|
57
|
+
/** Max number of values to return. Overflow is reported in the response. */
|
|
58
|
+
readonly limit: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Read interface exposed by PFrames library.
|
|
62
|
+
*
|
|
63
|
+
* Spec-side operations (finding columns, listing columns, retrieving
|
|
64
|
+
* column specs, computing axis integrations) are not part of this
|
|
65
|
+
* surface — callers cache column specs themselves or route through
|
|
66
|
+
* WASM-spec. The data-side `createTableV2` accepts a pre-lowered
|
|
67
|
+
* `DataQuery`; `getUniqueValues` takes pre-resolved indices via
|
|
68
|
+
* {@link UniqueValuesRequestV2}.
|
|
69
|
+
*/
|
|
70
|
+
interface PFrameReadAPIV12 {
|
|
71
|
+
/** Creates table from a pre-lowered data query. */
|
|
72
|
+
createTableV2(tableId: PTableId, dataQuery: DataQuery): PTableV9;
|
|
73
|
+
/** Calculate set of unique values for a specific axis for the filtered set of records. */
|
|
74
|
+
getUniqueValues(request: UniqueValuesRequestV2, ops?: {
|
|
75
|
+
signal?: AbortSignal;
|
|
76
|
+
}): Promise<UniqueValuesResponse>;
|
|
77
|
+
}
|
|
41
78
|
//#endregion
|
|
42
|
-
export { PFrameReadAPIV11 };
|
|
79
|
+
export { PFrameReadAPIV11, PFrameReadAPIV12, UniqueValuesRequestV2 };
|
|
43
80
|
//# sourceMappingURL=api_read.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_read.d.ts","names":[],"sources":["../../../src/pframe/internal_api/api_read.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"api_read.d.ts","names":[],"sources":["../../../src/pframe/internal_api/api_read.ts"],"mappings":";;;;;;;;;UAoBiB,gBAAA;EAAA;;;;;;;;EASf,WAAA,CAAY,OAAA,EAAS,kBAAA,GAAqB,OAAA,CAAQ,mBAAA;EAS1B;;;;EAHxB,YAAA,CAAa,OAAA,EAAS,8BAAA,GAAiC,OAAA,CAAQ,+BAAA;EAS1C;EANrB,aAAA,CAAc,QAAA,EAAU,SAAA,GAAY,OAAA,CAAQ,WAAA;EAMmB;EAH/D,WAAA,IAAe,OAAA,CAAQ,WAAA;EASR;EANf,WAAA,CAAY,OAAA,EAAS,QAAA,EAAU,OAAA,EAAS,oBAAA,GAAuB,QAAA;EAS5D;EANH,aAAA,CACE,OAAA,EAAS,QAAA,EACT,OAAA;IACE,SAAA,EAAW,gBAAA;IACX,SAAA,EAAW,SAAA;EAAA,IAEZ,QAAA;EAQO;EALV,eAAA,CACE,OAAA,EAAS,mBAAA,EACT,GAAA;IACE,MAAA,GAAS,WAAA;EAAA,IAEV,OAAA,CAAQ,oBAAA;AAAA;;;;;;;UASI,qBAAA;EAhCf;EAAA,SAkCS,QAAA,EAAU,SAAA;EAlCL;;;;EAAA,SAwCL,SAAA;EArCc;EAAA,SAwCd,OAAA,EAAS,0BAAA;EArCG;EAAA,SAwCZ,KAAA;AAAA;;;;;;;;;;;UAaM,gBAAA;EAzCf;EA2CA,aAAA,CAAc,OAAA,EAAS,QAAA,EAAU,SAAA,EAAW,SAAA,GAAY,QAAA;EA1CtD;EA6CF,eAAA,CACE,OAAA,EAAS,qBAAA,EACT,GAAA;IACE,MAAA,GAAS,WAAA;EAAA,IAEV,OAAA,CAAQ,oBAAA;AAAA"}
|
|
@@ -2,18 +2,18 @@ import { AxisQualification, ColumnAxesWithQualifications, ConstantAxisFilter, Lo
|
|
|
2
2
|
import { FindColumnResponseQualifications, FindColumnsMappingVariant, FindColumnsRequest, FindColumnsResponse, FindColumnsResponseHit } from "./find_columns.js";
|
|
3
3
|
import { DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse } from "./delete_column.js";
|
|
4
4
|
import { ArtificialColumnJoinEntry, ColumnJoinEntry, CreateTableRequestV4, FullJoinV4, InlineColumnJoinEntry, InnerJoinV4, JoinEntryV4, OuterJoinV4, SlicedColumnJoinEntry } from "./create_table.js";
|
|
5
|
-
import { PTableV8 } from "./table.js";
|
|
6
|
-
import { PFrameReadAPIV11 } from "./api_read.js";
|
|
5
|
+
import { PTableV8, PTableV9 } from "./table.js";
|
|
6
|
+
import { PFrameReadAPIV11, PFrameReadAPIV12, UniqueValuesRequestV2 } from "./api_read.js";
|
|
7
7
|
import { BaseObjectStore, FileRange, FsStoreOptions, HttpAuthorizationToken, HttpHelpers, HttpMethod, HttpRange, HttpServer, HttpServerInfo, HttpServerOptions, ObjectStore, ObjectStoreOptions, ObjectStoreResponse, ObjectStoreUrl, ParquetExtension, ParquetFileName, PemCertificate, RequestHandlerOptions } from "./http_helpers.js";
|
|
8
|
-
import { DataInfo, DataInfoExtension, FilePath, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV4, SpecExtension } from "./api_factory.js";
|
|
8
|
+
import { AddColumnEntry, DataInfo, DataInfoExtension, FilePath, PColumnValueTypeSpec, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV4, PFrameFactoryAPIV5, SpecExtension } from "./api_factory.js";
|
|
9
9
|
import { DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, MatcherMap, MultiAxisSelector, MultiColumnSelector, StringMatcher } from "./discover_columns.js";
|
|
10
10
|
import { EvaluateQueryResponse, LegacyQuery, PFrameWasmAPIV2, PFrameWasmAPIV3, PFrameWasmV2, PFrameWasmV3 } from "./api_wasm.js";
|
|
11
|
-
import { PFrameFactoryV4, PFrameOptionsV2, PFrameV13 } from "./pframe.js";
|
|
11
|
+
import { PFrameFactoryV4, PFrameFactoryV5, PFrameOptionsV2, PFrameV13, PFrameV14 } from "./pframe.js";
|
|
12
12
|
import { SingleAxisSelector as SingleAxisSelector$1 } from "@milaboratories/pl-model-common";
|
|
13
13
|
|
|
14
14
|
//#region src/pframe/internal_api/index.d.ts
|
|
15
15
|
declare namespace index_d_exports {
|
|
16
|
-
export { ArtificialColumnJoinEntry, AxisQualification, BaseObjectStore, ColumnAxesWithQualifications, ColumnJoinEntry, ConstantAxisFilter, CreateTableRequestV4, DataInfo, DataInfoExtension, DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse, DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, EvaluateQueryResponse, FilePath, FileRange, FindColumnResponseQualifications, FindColumnsMappingVariant, FindColumnsRequest, FindColumnsResponse, FindColumnsResponseHit, FsStoreOptions, FullJoinV4, HttpAuthorizationToken, HttpHelpers, HttpMethod, HttpRange, HttpServer, HttpServerInfo, HttpServerOptions, InlineColumnJoinEntry, InnerJoinV4, JoinEntryV4, LegacyQuery, Logger, MatcherMap, MultiAxisSelector, MultiColumnSelector, ObjectStore, ObjectStoreOptions, ObjectStoreResponse, ObjectStoreUrl, OuterJoinV4, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV4, PFrameFactoryV4, PFrameId, PFrameOptionsV2, PFrameReadAPIV11, PFrameV13, PFrameWasmAPIV2, PFrameWasmAPIV3, PFrameWasmV2, PFrameWasmV3, PTableId, PTableV8, ParquetExtension, ParquetFileName, PemCertificate, RequestHandlerOptions, SingleAxisSelector$1 as SingleAxisSelector, SlicedColumnJoinEntry, SpecExtension, StringMatcher };
|
|
16
|
+
export { AddColumnEntry, ArtificialColumnJoinEntry, AxisQualification, BaseObjectStore, ColumnAxesWithQualifications, ColumnJoinEntry, ConstantAxisFilter, CreateTableRequestV4, DataInfo, DataInfoExtension, DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse, DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, EvaluateQueryResponse, FilePath, FileRange, FindColumnResponseQualifications, FindColumnsMappingVariant, FindColumnsRequest, FindColumnsResponse, FindColumnsResponseHit, FsStoreOptions, FullJoinV4, HttpAuthorizationToken, HttpHelpers, HttpMethod, HttpRange, HttpServer, HttpServerInfo, HttpServerOptions, InlineColumnJoinEntry, InnerJoinV4, JoinEntryV4, LegacyQuery, Logger, MatcherMap, MultiAxisSelector, MultiColumnSelector, ObjectStore, ObjectStoreOptions, ObjectStoreResponse, ObjectStoreUrl, OuterJoinV4, PColumnValueTypeSpec, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV4, PFrameFactoryAPIV5, PFrameFactoryV4, PFrameFactoryV5, PFrameId, PFrameOptionsV2, PFrameReadAPIV11, PFrameReadAPIV12, PFrameV13, PFrameV14, PFrameWasmAPIV2, PFrameWasmAPIV3, PFrameWasmV2, PFrameWasmV3, PTableId, PTableV8, PTableV9, ParquetExtension, ParquetFileName, PemCertificate, RequestHandlerOptions, SingleAxisSelector$1 as SingleAxisSelector, SlicedColumnJoinEntry, SpecExtension, StringMatcher, UniqueValuesRequestV2 };
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
19
|
export { index_d_exports };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Logger, PFrameId } from "./common.js";
|
|
2
|
-
import { PFrameReadAPIV11 } from "./api_read.js";
|
|
3
|
-
import { PFrameFactoryAPIV4 } from "./api_factory.js";
|
|
2
|
+
import { PFrameReadAPIV11, PFrameReadAPIV12 } from "./api_read.js";
|
|
3
|
+
import { PFrameFactoryAPIV4, PFrameFactoryAPIV5 } from "./api_factory.js";
|
|
4
4
|
|
|
5
5
|
//#region src/pframe/internal_api/pframe.d.ts
|
|
6
6
|
interface PFrameV13 extends PFrameFactoryAPIV4, PFrameReadAPIV11 {}
|
|
7
|
+
/** Full PFrame surface — factory operations plus data-side reads. */
|
|
8
|
+
interface PFrameV14 extends PFrameFactoryAPIV5, PFrameReadAPIV12 {}
|
|
7
9
|
type PFrameOptionsV2 = {
|
|
8
10
|
/** PFrame ID for logging purposes */frameId: PFrameId; /** Path to directory where PFrame can create temporary files */
|
|
9
11
|
spillPath: string; /** Logger instance, no logging is performed when not provided */
|
|
@@ -25,6 +27,22 @@ interface PFrameFactoryV4 {
|
|
|
25
27
|
*/
|
|
26
28
|
pprofDump: () => Promise<Uint8Array>;
|
|
27
29
|
}
|
|
30
|
+
/** PFrame management functions exposed by the PFrame module. */
|
|
31
|
+
interface PFrameFactoryV5 {
|
|
32
|
+
/**
|
|
33
|
+
* Create a new PFrame instance.
|
|
34
|
+
* @warning Use concurrency limiting to avoid OOM crashes when multiple instances are simultaneously in use.
|
|
35
|
+
*/
|
|
36
|
+
createPFrame(options: PFrameOptionsV2): PFrameV14;
|
|
37
|
+
/**
|
|
38
|
+
* Dump active allocations from all PFrames instances in pprof format.
|
|
39
|
+
* The result of this function should be saved as `profile.pb.gz`.
|
|
40
|
+
* Use {@link https://pprof.me/} or {@link https://www.speedscope.app/}
|
|
41
|
+
* to view the allocation flamechart.
|
|
42
|
+
* @warning This method will always reject on Windows!
|
|
43
|
+
*/
|
|
44
|
+
pprofDump: () => Promise<Uint8Array>;
|
|
45
|
+
}
|
|
28
46
|
//#endregion
|
|
29
|
-
export { PFrameFactoryV4, PFrameOptionsV2, PFrameV13 };
|
|
47
|
+
export { PFrameFactoryV4, PFrameFactoryV5, PFrameOptionsV2, PFrameV13, PFrameV14 };
|
|
30
48
|
//# sourceMappingURL=pframe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pframe.d.ts","names":[],"sources":["../../../src/pframe/internal_api/pframe.ts"],"mappings":";;;;;UAKiB,SAAA,SAAkB,kBAAA,EAAoB,gBAAA;AAAA,KAE3C,eAAA;
|
|
1
|
+
{"version":3,"file":"pframe.d.ts","names":[],"sources":["../../../src/pframe/internal_api/pframe.ts"],"mappings":";;;;;UAKiB,SAAA,SAAkB,kBAAA,EAAoB,gBAAA;;UAGtC,SAAA,SAAkB,kBAAA,EAAoB,gBAAA;AAAA,KAE3C,eAAA;EAFK,qCAIf,OAAA,EAAS,QAAA;EAET,SAAA,UANqE;EAQrE,MAAA,GAAS,MAAA;AAAA;;UAIM,eAAA;EARf;;;;EAaA,YAAA,CAAa,OAAA,EAAS,eAAA,GAAkB,SAAA;EATzB;;AAIjB;;;;;EAcE,SAAA,QAAiB,OAAA,CAAQ,UAAA;AAAA;;UAIV,eAAA;EAbf;;;;EAkBA,YAAA,CAAa,OAAA,EAAS,eAAA,GAAkB,SAAA;EATvB;;;;AAInB;;;EAcE,SAAA,QAAiB,OAAA,CAAQ,UAAA;AAAA"}
|
|
@@ -55,6 +55,56 @@ interface PTableV8 extends Disposable {
|
|
|
55
55
|
/** Deallocates all underlying resources */
|
|
56
56
|
dispose(): void;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Table view returned by `createTableV2`, `filter`, and `sort`.
|
|
60
|
+
*
|
|
61
|
+
* PTable can be thought as having a composite primary key, consisting
|
|
62
|
+
* of axes, and a set of data columns derived from PColumn values.
|
|
63
|
+
* The table's column spec is owned by the caller — selector → index
|
|
64
|
+
* resolution runs on the caller side via WASM-spec.
|
|
65
|
+
*/
|
|
66
|
+
interface PTableV9 extends Disposable {
|
|
67
|
+
/**
|
|
68
|
+
* Get PTable disk footprint in bytes.
|
|
69
|
+
*
|
|
70
|
+
* @param ops.withPredecessors When true, the footprint includes
|
|
71
|
+
* every registered predecessor table reachable through the
|
|
72
|
+
* query lineage. When false or omitted, only this table's own
|
|
73
|
+
* materialised data is counted.
|
|
74
|
+
*
|
|
75
|
+
* Warning: This call materializes the join.
|
|
76
|
+
*/
|
|
77
|
+
getFootprint(ops?: {
|
|
78
|
+
withPredecessors?: boolean;
|
|
79
|
+
signal?: AbortSignal;
|
|
80
|
+
}): Promise<number>;
|
|
81
|
+
/**
|
|
82
|
+
* Unified table shape
|
|
83
|
+
* Warning: This call materializes the join.
|
|
84
|
+
*/
|
|
85
|
+
getShape(ops?: {
|
|
86
|
+
signal?: AbortSignal;
|
|
87
|
+
}): Promise<PTableShape>;
|
|
88
|
+
/**
|
|
89
|
+
* Retrieve the data from the table. To retrieve only data required, it can be
|
|
90
|
+
* sliced both horizontally ({@link columnIndices}) and vertically
|
|
91
|
+
* ({@link range}).
|
|
92
|
+
* This call materializes the join.
|
|
93
|
+
*
|
|
94
|
+
* @param columnIndices unified indices of columns to be retrieved
|
|
95
|
+
* @param range optionally limit the range of records to retrieve
|
|
96
|
+
* */
|
|
97
|
+
getData(columnIndices: number[], ops?: {
|
|
98
|
+
range?: TableRange;
|
|
99
|
+
signal?: AbortSignal;
|
|
100
|
+
}): Promise<PTableVector[]>;
|
|
101
|
+
/** Filters the table and returns new PTable instance */
|
|
102
|
+
filter(tableId: PTableId, request: PTableRecordFilter[]): PTableV9;
|
|
103
|
+
/** Sorts the table and returns new PTable instance. */
|
|
104
|
+
sort(tableId: PTableId, request: PTableSorting[]): PTableV9;
|
|
105
|
+
/** Deallocates all underlying resources */
|
|
106
|
+
dispose(): void;
|
|
107
|
+
}
|
|
58
108
|
//#endregion
|
|
59
|
-
export { PTableV8 };
|
|
109
|
+
export { PTableV8, PTableV9 };
|
|
60
110
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","names":[],"sources":["../../../src/pframe/internal_api/table.ts"],"mappings":";;;;;;AAiBA;;;;UAAiB,QAAA,SAAiB,UAAA;EAmBF;;;;;;;;;EAT9B,OAAA,IAAW,gBAAA;EAmCwB;EAhCnC,gBAAA,CAAiB,SAAA,EAAW,cAAA;EAmCd;;;;EA7Bd,YAAA,CAAa,GAAA;IAAQ,MAAA,GAAS,WAAA;EAAA,IAAgB,OAAA;EAT9C;;;;EAeA,QAAA,CAAS,GAAA;IAAQ,MAAA,GAAS,WAAA;EAAA,IAAgB,OAAA,CAAQ,WAAA;EANpB;;;;;;;;;EAiB9B,OAAA,CACE,aAAA,YACA,GAAA;IACE,KAAA,GAAQ,UAAA;IACR,MAAA,GAAS,WAAA;EAAA,IAEV,OAAA,CAAQ,YAAA;EAFP;EAKJ,MAAA,CAAO,OAAA,EAAS,QAAA,EAAU,OAAA,EAAS,kBAAA,KAAuB,QAAA;EAPxD;EAUF,IAAA,CAAK,OAAA,EAAS,QAAA,EAAU,OAAA,EAAS,aAAA,KAAkB,QAAA;EANxC;EASX,OAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"table.d.ts","names":[],"sources":["../../../src/pframe/internal_api/table.ts"],"mappings":";;;;;;AAiBA;;;;UAAiB,QAAA,SAAiB,UAAA;EAmBF;;;;;;;;;EAT9B,OAAA,IAAW,gBAAA;EAmCwB;EAhCnC,gBAAA,CAAiB,SAAA,EAAW,cAAA;EAmCd;;;;EA7Bd,YAAA,CAAa,GAAA;IAAQ,MAAA,GAAS,WAAA;EAAA,IAAgB,OAAA;EAT9C;;;;EAeA,QAAA,CAAS,GAAA;IAAQ,MAAA,GAAS,WAAA;EAAA,IAAgB,OAAA,CAAQ,WAAA;EANpB;;;;;;;;;EAiB9B,OAAA,CACE,aAAA,YACA,GAAA;IACE,KAAA,GAAQ,UAAA;IACR,MAAA,GAAS,WAAA;EAAA,IAEV,OAAA,CAAQ,YAAA;EAFP;EAKJ,MAAA,CAAO,OAAA,EAAS,QAAA,EAAU,OAAA,EAAS,kBAAA,KAAuB,QAAA;EAPxD;EAUF,IAAA,CAAK,OAAA,EAAS,QAAA,EAAU,OAAA,EAAS,aAAA,KAAkB,QAAA;EANxC;EASX,OAAA;AAAA;;;;;;;;;UAWe,QAAA,SAAiB,UAAA;EAdmB;;;;AAcrD;;;;;;EAWE,YAAA,CAAa,GAAA;IAAQ,gBAAA;IAA4B,MAAA,GAAS,WAAA;EAAA,IAAgB,OAAA;EAuB/D;;;;EAjBX,QAAA,CAAS,GAAA;IAAQ,MAAA,GAAS,WAAA;EAAA,IAAgB,OAAA,CAAQ,WAAA;EAuBC;;;;;;;;;EAZnD,OAAA,CACE,aAAA,YACA,GAAA;IACE,KAAA,GAAQ,UAAA;IACR,MAAA,GAAS,WAAA;EAAA,IAEV,OAAA,CAAQ,YAAA;EAjBe;EAoB1B,MAAA,CAAO,OAAA,EAAS,QAAA,EAAU,OAAA,EAAS,kBAAA,KAAuB,QAAA;EApBhB;EAuB1C,IAAA,CAAK,OAAA,EAAS,QAAA,EAAU,OAAA,EAAS,aAAA,KAAkB,QAAA;EAZnD;EAeA,OAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-model-middle-layer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "Common model between middle layer and non-block UI code",
|
|
5
5
|
"files": [
|
|
6
6
|
"./dist/**/*",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "~24.5.2",
|
|
28
28
|
"typescript": "~5.9.3",
|
|
29
|
+
"@milaboratories/ts-builder": "1.5.0",
|
|
29
30
|
"@milaboratories/build-configs": "2.0.0",
|
|
30
|
-
"@milaboratories/ts-configs": "1.2.3"
|
|
31
|
-
"@milaboratories/ts-builder": "1.5.0"
|
|
31
|
+
"@milaboratories/ts-configs": "1.2.3"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "ts-builder build --target node",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
AxisValueType,
|
|
2
3
|
BinaryPartitionedDataInfo,
|
|
3
4
|
Branded,
|
|
5
|
+
ColumnValueType,
|
|
4
6
|
JsonDataInfo,
|
|
5
7
|
JsonPartitionedDataInfo,
|
|
6
8
|
ParquetChunk,
|
|
@@ -79,3 +81,45 @@ export interface PFrameFactoryAPIV4 extends Disposable {
|
|
|
79
81
|
* any interactions with disposed PFrame will result in exception */
|
|
80
82
|
dispose(): void;
|
|
81
83
|
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Structural type information needed by the data side: axis value
|
|
87
|
+
* types and column value types, in their canonical order. Mirrors
|
|
88
|
+
* the bridge-side `TypeSpec`.
|
|
89
|
+
*/
|
|
90
|
+
export interface PColumnValueTypeSpec {
|
|
91
|
+
readonly axes: AxisValueType[];
|
|
92
|
+
readonly columns: ColumnValueType[];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Single column entry for {@link PFrameFactoryAPIV5.addColumns}. */
|
|
96
|
+
export interface AddColumnEntry {
|
|
97
|
+
/** Unique column identifier within the PFrame. */
|
|
98
|
+
readonly id: PObjectId;
|
|
99
|
+
/** Structural type info (axes / column value types). */
|
|
100
|
+
readonly typeSpec: PColumnValueTypeSpec;
|
|
101
|
+
/** Data info for the column. */
|
|
102
|
+
readonly data: DataInfo<PFrameBlobId>;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** API for populating a PFrame with columns and a data source. */
|
|
106
|
+
export interface PFrameFactoryAPIV5 extends Disposable {
|
|
107
|
+
/** Associates data source with this PFrame. */
|
|
108
|
+
setDataSource(dataSource: PFrameDataSourceV2): void;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Registers all PColumns at once: specs are recorded and data info
|
|
112
|
+
* is attached atomically. For parquet data info, schema resolution
|
|
113
|
+
* via network is performed during this call.
|
|
114
|
+
*/
|
|
115
|
+
addColumns(
|
|
116
|
+
columns: AddColumnEntry[],
|
|
117
|
+
options?: {
|
|
118
|
+
signal?: AbortSignal;
|
|
119
|
+
},
|
|
120
|
+
): Promise<void>;
|
|
121
|
+
|
|
122
|
+
/** Releases all the data previously added to PFrame using methods above,
|
|
123
|
+
* any interactions with disposed PFrame will result in exception */
|
|
124
|
+
dispose(): void;
|
|
125
|
+
}
|
|
@@ -10,10 +10,11 @@ import type {
|
|
|
10
10
|
UniqueValuesRequest,
|
|
11
11
|
UniqueValuesResponse,
|
|
12
12
|
DataQuery,
|
|
13
|
+
DataQueryBooleanExpression,
|
|
13
14
|
PTableColumnSpec,
|
|
14
15
|
} from "@milaboratories/pl-model-common";
|
|
15
16
|
import type { CreateTableRequestV4 } from "./create_table";
|
|
16
|
-
import type { PTableV8 } from "./table";
|
|
17
|
+
import type { PTableV8, PTableV9 } from "./table";
|
|
17
18
|
import type { PTableId } from "./common";
|
|
18
19
|
|
|
19
20
|
/** Read interface exposed by PFrames library */
|
|
@@ -60,3 +61,49 @@ export interface PFrameReadAPIV11 {
|
|
|
60
61
|
},
|
|
61
62
|
): Promise<UniqueValuesResponse>;
|
|
62
63
|
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* V2 unique-values request. Axis and filter references are
|
|
67
|
+
* pre-resolved to numeric indices; no selector ids cross the API
|
|
68
|
+
* boundary. Each filter is a boolean predicate that must evaluate to
|
|
69
|
+
* true for the row to be included.
|
|
70
|
+
*/
|
|
71
|
+
export interface UniqueValuesRequestV2 {
|
|
72
|
+
/** Target column. */
|
|
73
|
+
readonly columnId: PObjectId;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Target axis (pre-resolved index into the column's axes).
|
|
77
|
+
* When omitted, unique values are collected from the column itself.
|
|
78
|
+
*/
|
|
79
|
+
readonly axisIndex?: number;
|
|
80
|
+
|
|
81
|
+
/** Pre-resolved boolean predicates applied before collecting values. */
|
|
82
|
+
readonly filters: DataQueryBooleanExpression[];
|
|
83
|
+
|
|
84
|
+
/** Max number of values to return. Overflow is reported in the response. */
|
|
85
|
+
readonly limit: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Read interface exposed by PFrames library.
|
|
90
|
+
*
|
|
91
|
+
* Spec-side operations (finding columns, listing columns, retrieving
|
|
92
|
+
* column specs, computing axis integrations) are not part of this
|
|
93
|
+
* surface — callers cache column specs themselves or route through
|
|
94
|
+
* WASM-spec. The data-side `createTableV2` accepts a pre-lowered
|
|
95
|
+
* `DataQuery`; `getUniqueValues` takes pre-resolved indices via
|
|
96
|
+
* {@link UniqueValuesRequestV2}.
|
|
97
|
+
*/
|
|
98
|
+
export interface PFrameReadAPIV12 {
|
|
99
|
+
/** Creates table from a pre-lowered data query. */
|
|
100
|
+
createTableV2(tableId: PTableId, dataQuery: DataQuery): PTableV9;
|
|
101
|
+
|
|
102
|
+
/** Calculate set of unique values for a specific axis for the filtered set of records. */
|
|
103
|
+
getUniqueValues(
|
|
104
|
+
request: UniqueValuesRequestV2,
|
|
105
|
+
ops?: {
|
|
106
|
+
signal?: AbortSignal;
|
|
107
|
+
},
|
|
108
|
+
): Promise<UniqueValuesResponse>;
|
|
109
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type { PFrameFactoryAPIV4 } from "./api_factory";
|
|
2
|
-
import type { PFrameReadAPIV11 } from "./api_read";
|
|
1
|
+
import type { PFrameFactoryAPIV4, PFrameFactoryAPIV5 } from "./api_factory";
|
|
2
|
+
import type { PFrameReadAPIV11, PFrameReadAPIV12 } from "./api_read";
|
|
3
3
|
import type { Logger } from "./common";
|
|
4
4
|
import type { PFrameId } from "./common";
|
|
5
5
|
|
|
6
6
|
export interface PFrameV13 extends PFrameFactoryAPIV4, PFrameReadAPIV11 {}
|
|
7
7
|
|
|
8
|
+
/** Full PFrame surface — factory operations plus data-side reads. */
|
|
9
|
+
export interface PFrameV14 extends PFrameFactoryAPIV5, PFrameReadAPIV12 {}
|
|
10
|
+
|
|
8
11
|
export type PFrameOptionsV2 = {
|
|
9
12
|
/** PFrame ID for logging purposes */
|
|
10
13
|
frameId: PFrameId;
|
|
@@ -31,3 +34,21 @@ export interface PFrameFactoryV4 {
|
|
|
31
34
|
*/
|
|
32
35
|
pprofDump: () => Promise<Uint8Array>;
|
|
33
36
|
}
|
|
37
|
+
|
|
38
|
+
/** PFrame management functions exposed by the PFrame module. */
|
|
39
|
+
export interface PFrameFactoryV5 {
|
|
40
|
+
/**
|
|
41
|
+
* Create a new PFrame instance.
|
|
42
|
+
* @warning Use concurrency limiting to avoid OOM crashes when multiple instances are simultaneously in use.
|
|
43
|
+
*/
|
|
44
|
+
createPFrame(options: PFrameOptionsV2): PFrameV14;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Dump active allocations from all PFrames instances in pprof format.
|
|
48
|
+
* The result of this function should be saved as `profile.pb.gz`.
|
|
49
|
+
* Use {@link https://pprof.me/} or {@link https://www.speedscope.app/}
|
|
50
|
+
* to view the allocation flamechart.
|
|
51
|
+
* @warning This method will always reject on Windows!
|
|
52
|
+
*/
|
|
53
|
+
pprofDump: () => Promise<Uint8Array>;
|
|
54
|
+
}
|
|
@@ -68,3 +68,57 @@ export interface PTableV8 extends Disposable {
|
|
|
68
68
|
/** Deallocates all underlying resources */
|
|
69
69
|
dispose(): void;
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Table view returned by `createTableV2`, `filter`, and `sort`.
|
|
74
|
+
*
|
|
75
|
+
* PTable can be thought as having a composite primary key, consisting
|
|
76
|
+
* of axes, and a set of data columns derived from PColumn values.
|
|
77
|
+
* The table's column spec is owned by the caller — selector → index
|
|
78
|
+
* resolution runs on the caller side via WASM-spec.
|
|
79
|
+
*/
|
|
80
|
+
export interface PTableV9 extends Disposable {
|
|
81
|
+
/**
|
|
82
|
+
* Get PTable disk footprint in bytes.
|
|
83
|
+
*
|
|
84
|
+
* @param ops.withPredecessors When true, the footprint includes
|
|
85
|
+
* every registered predecessor table reachable through the
|
|
86
|
+
* query lineage. When false or omitted, only this table's own
|
|
87
|
+
* materialised data is counted.
|
|
88
|
+
*
|
|
89
|
+
* Warning: This call materializes the join.
|
|
90
|
+
*/
|
|
91
|
+
getFootprint(ops?: { withPredecessors?: boolean; signal?: AbortSignal }): Promise<number>;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Unified table shape
|
|
95
|
+
* Warning: This call materializes the join.
|
|
96
|
+
*/
|
|
97
|
+
getShape(ops?: { signal?: AbortSignal }): Promise<PTableShape>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Retrieve the data from the table. To retrieve only data required, it can be
|
|
101
|
+
* sliced both horizontally ({@link columnIndices}) and vertically
|
|
102
|
+
* ({@link range}).
|
|
103
|
+
* This call materializes the join.
|
|
104
|
+
*
|
|
105
|
+
* @param columnIndices unified indices of columns to be retrieved
|
|
106
|
+
* @param range optionally limit the range of records to retrieve
|
|
107
|
+
* */
|
|
108
|
+
getData(
|
|
109
|
+
columnIndices: number[],
|
|
110
|
+
ops?: {
|
|
111
|
+
range?: TableRange;
|
|
112
|
+
signal?: AbortSignal;
|
|
113
|
+
},
|
|
114
|
+
): Promise<PTableVector[]>;
|
|
115
|
+
|
|
116
|
+
/** Filters the table and returns new PTable instance */
|
|
117
|
+
filter(tableId: PTableId, request: PTableRecordFilter[]): PTableV9;
|
|
118
|
+
|
|
119
|
+
/** Sorts the table and returns new PTable instance. */
|
|
120
|
+
sort(tableId: PTableId, request: PTableSorting[]): PTableV9;
|
|
121
|
+
|
|
122
|
+
/** Deallocates all underlying resources */
|
|
123
|
+
dispose(): void;
|
|
124
|
+
}
|