@milaboratories/pl-middle-layer 1.31.9 → 1.32.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/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +589 -580
- package/dist/index.mjs.map +1 -1
- package/dist/js_render/context.d.ts +10 -3
- package/dist/js_render/context.d.ts.map +1 -1
- package/dist/pool/data.d.ts +6 -7
- package/dist/pool/data.d.ts.map +1 -1
- package/dist/pool/driver.d.ts +5 -5
- package/dist/pool/driver.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/js_render/context.ts +23 -4
- package/src/pool/data.ts +19 -20
- package/src/pool/driver.ts +15 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComputableCtx, Computable } from '@milaboratories/computable';
|
|
2
|
-
import { ArchiveFormat, CommonFieldTraverseOps as CommonFieldTraverseOpsFromSDK, FieldTraversalStep as FieldTraversalStepFromSDK, Option, PColumn, PColumnValues, PFrameDef, PFrameHandle, PObject, PObjectSpec, PSpecPredicate, PTableDef, PTableHandle, ResourceType as ResourceTypeFromSDK, ResultCollection, ValueOrError, JsRenderInternal } from '@platforma-sdk/model';
|
|
2
|
+
import { ArchiveFormat, CommonFieldTraverseOps as CommonFieldTraverseOpsFromSDK, DataInfo, FieldTraversalStep as FieldTraversalStepFromSDK, Option, PColumn, PColumnValues, PFrameDef, PFrameHandle, PObject, PObjectSpec, PSpecPredicate, PTableDef, PTableHandle, ResourceType as ResourceTypeFromSDK, ResultCollection, ValueOrError, JsRenderInternal } from '@platforma-sdk/model';
|
|
3
3
|
import { QuickJSContext, QuickJSHandle, Scope, errors } from 'quickjs-emscripten';
|
|
4
4
|
import { Optional } from 'utility-types';
|
|
5
5
|
import { BlockContextAny } from '../middle_layer/block_ctx';
|
|
@@ -58,8 +58,15 @@ export declare class JsExecutionContext implements JsRenderInternal.GlobalCfgRen
|
|
|
58
58
|
getSpecsFromResultPool(): ResultCollection<PObjectSpec>;
|
|
59
59
|
getSpecFromResultPoolByRef(blockId: string, exportName: string): PObjectSpec | undefined;
|
|
60
60
|
getDataFromResultPoolByRef(blockId: string, exportName: string): PObject<string> | undefined;
|
|
61
|
-
createPFrame(def: PFrameDef<string | PColumnValues
|
|
62
|
-
createPTable(def: PTableDef<PColumn<string | PColumnValues
|
|
61
|
+
createPFrame(def: PFrameDef<string | PColumnValues | DataInfo<string>>): PFrameHandle;
|
|
62
|
+
createPTable(def: PTableDef<PColumn<string | PColumnValues | DataInfo<string>>>): PTableHandle;
|
|
63
|
+
/**
|
|
64
|
+
* Transforms input data for PFrame/PTable creation
|
|
65
|
+
* - Converts string handles to accessors
|
|
66
|
+
* - Maps accessors in DataInfo objects
|
|
67
|
+
* - Passes through other values
|
|
68
|
+
*/
|
|
69
|
+
private transformInputPData;
|
|
63
70
|
getCurrentUnstableMarker(): string | undefined;
|
|
64
71
|
private getAccessor;
|
|
65
72
|
private wrapAccessor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/js_render/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,IAAI,6BAA6B,EACvD,kBAAkB,IAAI,yBAAyB,EAC/C,MAAM,EACN,OAAO,EACP,aAAa,EACb,SAAS,EACT,YAAY,EACZ,OAAO,EACP,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,YAAY,IAAI,mBAAmB,EACnC,gBAAgB,EAChB,YAAY,EACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/js_render/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CA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AAC,KAAK,EAAE,OAAO,GAAG;QAC/C,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB;IAiBD,sFAAsF;IAC/E,WAAW,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO;CAwBnD;AAED,uCAAuC;AACvC,qBAAa,UAAW,SAAQ,KAAK;IAC5B,KAAK,EAAE,MAAM,CAAC;gBAGnB,YAAY,EAAE,MAAM,CAAC,kBAAkB,EACvC,KAAK,EAAE,KAAK;IAad,QAAQ;CAOT"}
|
package/dist/pool/data.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { PColumnSpec, PColumnValues, PObjectId, PObjectSpec } from '@platforma-sdk/model';
|
|
2
|
-
import { PFrameInternal } from '@milaboratories/pl-model-middle-layer';
|
|
1
|
+
import { DataInfo, JsonDataInfo, PColumnSpec, PColumnValue, PColumnValues, PObjectId, PObjectSpec } from '@platforma-sdk/model';
|
|
3
2
|
import { PlTreeNodeAccessor, ResourceInfo } from '@milaboratories/pl-tree';
|
|
4
3
|
import { ResourceType } from '@milaboratories/pl-client';
|
|
5
|
-
export declare function allBlobs<B>(data:
|
|
6
|
-
export declare function mapBlobs<B1, B2>(data:
|
|
4
|
+
export declare function allBlobs<B>(data: DataInfo<B>): Generator<B>;
|
|
5
|
+
export declare function mapBlobs<B1, B2>(data: DataInfo<B1>, mapping: (blob: B1) => B2): DataInfo<B2>;
|
|
7
6
|
export declare const PColumnDataJsonPartitioned: ResourceType;
|
|
8
7
|
export declare const PColumnDataJsonSuperPartitioned: ResourceType;
|
|
9
8
|
export declare const PColumnDataBinaryPartitioned: ResourceType;
|
|
@@ -11,7 +10,7 @@ export declare const PColumnDataBinarySuperPartitioned: ResourceType;
|
|
|
11
10
|
export declare const PColumnDataJson: ResourceType;
|
|
12
11
|
export type PColumnDataJsonResourceValue = {
|
|
13
12
|
keyLength: number;
|
|
14
|
-
data: Record<string,
|
|
13
|
+
data: Record<string, PColumnValue>;
|
|
15
14
|
};
|
|
16
15
|
export type PColumnDataPartitionedResourceValue = {
|
|
17
16
|
partitionKeyLength: number;
|
|
@@ -20,8 +19,8 @@ export type PColumnDataSuperPartitionedResourceValue = {
|
|
|
20
19
|
superPartitionKeyLength: number;
|
|
21
20
|
partitionKeyLength: number;
|
|
22
21
|
};
|
|
23
|
-
export declare function parseDataInfoResource(data: PlTreeNodeAccessor):
|
|
24
|
-
export declare function
|
|
22
|
+
export declare function parseDataInfoResource(data: PlTreeNodeAccessor): DataInfo<ResourceInfo>;
|
|
23
|
+
export declare function makeDataInfoFromPColumnValues(spec: PColumnSpec, data: PColumnValues): JsonDataInfo;
|
|
25
24
|
export declare function deriveLegacyPObjectId(spec: PObjectSpec, data: PlTreeNodeAccessor): PObjectId;
|
|
26
25
|
export declare function deriveGlobalPObjectId(blockId: string, exportName: string): PObjectId;
|
|
27
26
|
export declare function deriveLocalPObjectId(resolvePath: string[], outputName: string): PObjectId;
|
package/dist/pool/data.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/pool/data.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/pool/data.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAe,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACzJ,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAYhF,wBAAiB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAgB5D;AAYD,wBAAgB,QAAQ,CAAC,EAAE,EAAE,EAAE,EAC7B,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,EAClB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,GACxB,QAAQ,CAAC,EAAE,CAAC,CAiBd;AAED,eAAO,MAAM,0BAA0B,kDAAmD,CAAC;AAC3F,eAAO,MAAM,+BAA+B,kDAG3C,CAAC;AACF,eAAO,MAAM,4BAA4B,kDAAqD,CAAC;AAC/F,eAAO,MAAM,iCAAiC,kDAG7C,CAAC;AACF,eAAO,MAAM,eAAe,kDAAwC,CAAC;AAErE,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,wCAAwC,GAAG;IACrD,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,kBAAkB,GACvB,QAAQ,CAAC,YAAY,CAAC,CAkJxB;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,aAAa,GAClB,YAAY,CAcd;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,GAAG,SAAS,CAK5F;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAEpF;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAEzF"}
|
package/dist/pool/driver.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DownloadDriver } from '@milaboratories/pl-drivers';
|
|
2
2
|
import { PlTreeNodeAccessor } from '@milaboratories/pl-tree';
|
|
3
3
|
import { ComputableCtx } from '@milaboratories/computable';
|
|
4
|
-
import { CalculateTableDataRequest, CalculateTableDataResponse, FindColumnsRequest, FindColumnsResponse, PColumnIdAndSpec, PColumnSpec, PFrameHandle, PObjectId, PTableColumnSpec, PTableHandle, PTableShape, PTableVector, TableRange, UniqueValuesRequest, UniqueValuesResponse, PFrameDriver as SdkPFrameDriver, PColumn, PFrameDef, PTableDef, PColumnValues } from '@platforma-sdk/model';
|
|
4
|
+
import { CalculateTableDataRequest, CalculateTableDataResponse, FindColumnsRequest, FindColumnsResponse, PColumnIdAndSpec, PColumnSpec, PFrameHandle, PObjectId, PTableColumnSpec, PTableHandle, PTableShape, PTableVector, TableRange, UniqueValuesRequest, UniqueValuesResponse, PFrameDriver as SdkPFrameDriver, PColumn, PFrameDef, PTableDef, PColumnValues, DataInfo } from '@platforma-sdk/model';
|
|
5
5
|
import { MiLogger } from '@milaboratories/ts-helpers';
|
|
6
6
|
/**
|
|
7
7
|
* Extends public and safe SDK's driver API with methods used internally in the middle
|
|
@@ -9,9 +9,9 @@ import { MiLogger } from '@milaboratories/ts-helpers';
|
|
|
9
9
|
*/
|
|
10
10
|
export interface InternalPFrameDriver extends SdkPFrameDriver {
|
|
11
11
|
/** Create a new PFrame */
|
|
12
|
-
createPFrame(def: PFrameDef<PlTreeNodeAccessor | PColumnValues
|
|
12
|
+
createPFrame(def: PFrameDef<PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor>>, ctx: ComputableCtx): PFrameHandle;
|
|
13
13
|
/** Create a new PTable */
|
|
14
|
-
createPTable(def: PTableDef<PColumn<PlTreeNodeAccessor | PColumnValues
|
|
14
|
+
createPTable(def: PTableDef<PColumn<PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor>>>, ctx: ComputableCtx, signal?: AbortSignal): PTableHandle;
|
|
15
15
|
/** Calculates data for the table and returns complete data representation of it */
|
|
16
16
|
calculateTableData(handle: PFrameHandle, request: CalculateTableDataRequest<PObjectId>, signal?: AbortSignal): Promise<CalculateTableDataResponse>;
|
|
17
17
|
/** Calculate set of unique values for a specific axis for the filtered set of records */
|
|
@@ -26,8 +26,8 @@ export declare class PFrameDriver implements InternalPFrameDriver {
|
|
|
26
26
|
/** Limits concurrent requests to PFrame API to prevent deadlock with Node's IO threads */
|
|
27
27
|
private readonly concurrencyLimiter;
|
|
28
28
|
constructor(blobDriver: DownloadDriver, logger: MiLogger);
|
|
29
|
-
createPFrame(def: PFrameDef<PlTreeNodeAccessor | PColumnValues
|
|
30
|
-
createPTable(def: PTableDef<PColumn<PlTreeNodeAccessor | PColumnValues
|
|
29
|
+
createPFrame(def: PFrameDef<PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor>>, ctx: ComputableCtx): PFrameHandle;
|
|
30
|
+
createPTable(def: PTableDef<PColumn<PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor>>>, ctx: ComputableCtx, signal?: AbortSignal): PTableHandle;
|
|
31
31
|
findColumns(handle: PFrameHandle, request: FindColumnsRequest): Promise<FindColumnsResponse>;
|
|
32
32
|
getColumnSpec(handle: PFrameHandle, columnId: PObjectId): Promise<PColumnSpec>;
|
|
33
33
|
listColumns(handle: PFrameHandle): Promise<PColumnIdAndSpec[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/pool/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,KAAK,EAAE,kBAAkB,EAAgB,MAAM,yBAAyB,CAAC;AAEhF,OAAO,KAAK,EAAE,aAAa,EAA2B,MAAM,4BAA4B,CAAC;AACzF,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EAEnB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,EAC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kB,CAC7B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC7C,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,0BAA0B,CAAC;IAoEzB,eAAe,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,mBAAmB,EAC5B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,oBAAoB,CAAC;IAgCnB,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAKpD,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAK1D,OAAO,CAClB,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,MAAM,EAAE,EACvB,KAAK,CAAC,EAAE,UAAU,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC;CAM3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-middle-layer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"description": "Pl Middle Layer",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.16.0"
|
|
@@ -33,21 +33,21 @@
|
|
|
33
33
|
"yaml": "^2.7.0",
|
|
34
34
|
"zod": "~3.23.8",
|
|
35
35
|
"@milaboratories/pl-http": "^1.1.2",
|
|
36
|
+
"@milaboratories/computable": "^2.4.2",
|
|
36
37
|
"@milaboratories/pl-client": "^2.7.14",
|
|
37
38
|
"@milaboratories/resolve-helper": "^1.1.0",
|
|
38
|
-
"@milaboratories/pl-drivers": "^1.5.
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@milaboratories/pl-model-
|
|
42
|
-
"@milaboratories/pl-model-common": "^1.12.0",
|
|
43
|
-
"@milaboratories/pl-model-backend": "^1.0.3",
|
|
39
|
+
"@milaboratories/pl-drivers": "^1.5.37",
|
|
40
|
+
"@platforma-sdk/block-tools": "^2.5.29",
|
|
41
|
+
"@milaboratories/pl-model-middle-layer": "^1.7.16",
|
|
42
|
+
"@milaboratories/pl-model-common": "^1.13.0",
|
|
44
43
|
"@milaboratories/pl-tree": "^1.5.2",
|
|
45
|
-
"@
|
|
46
|
-
"@platforma-sdk/
|
|
44
|
+
"@milaboratories/pl-model-backend": "^1.0.3",
|
|
45
|
+
"@platforma-sdk/model": "^1.26.0",
|
|
47
46
|
"@milaboratories/ts-helpers": "^1.1.5",
|
|
48
47
|
"@milaboratories/pl-config": "^1.4.5",
|
|
49
|
-
"@
|
|
50
|
-
"@milaboratories/pl-deployments": "^1.7.1"
|
|
48
|
+
"@platforma-sdk/workflow-tengo": "3.2.0",
|
|
49
|
+
"@milaboratories/pl-deployments": "^1.7.1",
|
|
50
|
+
"@milaboratories/pl-errors": "^1.0.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"semver": "^7.6.3",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"jest": "^29.7.0",
|
|
60
60
|
"@jest/globals": "^29.7.0",
|
|
61
61
|
"ts-jest": "^29.2.6",
|
|
62
|
-
"@milaboratories/
|
|
63
|
-
"@milaboratories/
|
|
62
|
+
"@milaboratories/platforma-build-configs": "1.0.3",
|
|
63
|
+
"@milaboratories/eslint-config": "^1.0.4"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"type-check": "tsc --noEmit --composite false",
|
package/src/js_render/context.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { PlTreeNodeAccessor } from '@milaboratories/pl-tree';
|
|
|
4
4
|
import type {
|
|
5
5
|
ArchiveFormat,
|
|
6
6
|
CommonFieldTraverseOps as CommonFieldTraverseOpsFromSDK,
|
|
7
|
+
DataInfo,
|
|
7
8
|
FieldTraversalStep as FieldTraversalStepFromSDK,
|
|
8
9
|
Option,
|
|
9
10
|
PColumn,
|
|
@@ -20,7 +21,9 @@ import type {
|
|
|
20
21
|
ValueOrError,
|
|
21
22
|
} from '@platforma-sdk/model';
|
|
22
23
|
import {
|
|
24
|
+
isDataInfo,
|
|
23
25
|
JsRenderInternal,
|
|
26
|
+
mapDataInfo,
|
|
24
27
|
mapPObjectData,
|
|
25
28
|
mapPTableDef,
|
|
26
29
|
mapValueInVOE,
|
|
@@ -438,30 +441,46 @@ implements JsRenderInternal.GlobalCfgRenderCtxMethods<string, string> {
|
|
|
438
441
|
// PFrames / PTables
|
|
439
442
|
//
|
|
440
443
|
|
|
441
|
-
public createPFrame(def: PFrameDef<string | PColumnValues
|
|
444
|
+
public createPFrame(def: PFrameDef<string | PColumnValues | DataInfo<string>>): PFrameHandle {
|
|
442
445
|
if (this.computableCtx === undefined)
|
|
443
446
|
throw new Error(
|
|
444
447
|
'can\'t instantiate PFrames from this context (most porbably called from the future mapper)',
|
|
445
448
|
);
|
|
446
449
|
return this.env.driverKit.pFrameDriver.createPFrame(
|
|
447
|
-
def.map((c) => mapPObjectData(c, (d) =>
|
|
450
|
+
def.map((c) => mapPObjectData(c, (d) => this.transformInputPData(d))),
|
|
448
451
|
this.computableCtx,
|
|
449
452
|
);
|
|
450
453
|
}
|
|
451
454
|
|
|
452
|
-
public createPTable(def: PTableDef<PColumn<string | PColumnValues
|
|
455
|
+
public createPTable(def: PTableDef<PColumn<string | PColumnValues | DataInfo<string>>>): PTableHandle {
|
|
453
456
|
if (this.computableCtx === undefined)
|
|
454
457
|
throw new Error(
|
|
455
458
|
'can\'t instantiate PTable from this context (most porbably called from the future mapper)',
|
|
456
459
|
);
|
|
457
460
|
return this.env.driverKit.pFrameDriver.createPTable(
|
|
458
461
|
mapPTableDef(def, (c) =>
|
|
459
|
-
mapPObjectData(c, (d) =>
|
|
462
|
+
mapPObjectData(c, (d) => this.transformInputPData(d)),
|
|
460
463
|
),
|
|
461
464
|
this.computableCtx,
|
|
462
465
|
);
|
|
463
466
|
}
|
|
464
467
|
|
|
468
|
+
/**
|
|
469
|
+
* Transforms input data for PFrame/PTable creation
|
|
470
|
+
* - Converts string handles to accessors
|
|
471
|
+
* - Maps accessors in DataInfo objects
|
|
472
|
+
* - Passes through other values
|
|
473
|
+
*/
|
|
474
|
+
private transformInputPData(d: string | PColumnValues | DataInfo<string>): PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor> {
|
|
475
|
+
if (typeof d === 'string') {
|
|
476
|
+
return this.getAccessor(d);
|
|
477
|
+
} else if (isDataInfo(d)) {
|
|
478
|
+
return mapDataInfo(d, (a) => this.getAccessor(a));
|
|
479
|
+
} else {
|
|
480
|
+
return d;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
465
484
|
//
|
|
466
485
|
// Computable
|
|
467
486
|
//
|
package/src/pool/data.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { PColumnSpec, PColumnValues, PlRef, PObjectId, PObjectSpec } from '@platforma-sdk/model';
|
|
2
|
-
import type { PFrameInternal } from '@milaboratories/pl-model-middle-layer';
|
|
1
|
+
import type { BinaryChunk, DataInfo, JsonDataInfo, PColumnSpec, PColumnValue, PColumnValues, PlRef, PObjectId, PObjectSpec } from '@platforma-sdk/model';
|
|
3
2
|
import type { PlTreeNodeAccessor, ResourceInfo } from '@milaboratories/pl-tree';
|
|
4
3
|
import { assertNever } from '@milaboratories/ts-helpers';
|
|
5
4
|
import canonicalize from 'canonicalize';
|
|
@@ -12,7 +11,7 @@ import {
|
|
|
12
11
|
import type { Writable } from 'utility-types';
|
|
13
12
|
import { createHash } from 'node:crypto';
|
|
14
13
|
|
|
15
|
-
export function* allBlobs<B>(data:
|
|
14
|
+
export function* allBlobs<B>(data: DataInfo<B>): Generator<B> {
|
|
16
15
|
switch (data.type) {
|
|
17
16
|
case 'Json':
|
|
18
17
|
return;
|
|
@@ -41,9 +40,9 @@ function mapValues<T extends object, TResult>(
|
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
export function mapBlobs<B1, B2>(
|
|
44
|
-
data:
|
|
43
|
+
data: DataInfo<B1>,
|
|
45
44
|
mapping: (blob: B1) => B2,
|
|
46
|
-
):
|
|
45
|
+
): DataInfo<B2> {
|
|
47
46
|
switch (data.type) {
|
|
48
47
|
case 'Json':
|
|
49
48
|
return { ...data };
|
|
@@ -76,7 +75,7 @@ export const PColumnDataJson = resourceType('PColumnData/Json', '1');
|
|
|
76
75
|
|
|
77
76
|
export type PColumnDataJsonResourceValue = {
|
|
78
77
|
keyLength: number;
|
|
79
|
-
data: Record<string,
|
|
78
|
+
data: Record<string, PColumnValue>;
|
|
80
79
|
};
|
|
81
80
|
|
|
82
81
|
export type PColumnDataPartitionedResourceValue = {
|
|
@@ -90,7 +89,7 @@ export type PColumnDataSuperPartitionedResourceValue = {
|
|
|
90
89
|
|
|
91
90
|
export function parseDataInfoResource(
|
|
92
91
|
data: PlTreeNodeAccessor,
|
|
93
|
-
):
|
|
92
|
+
): DataInfo<ResourceInfo> {
|
|
94
93
|
if (!data.getIsReadyOrError()) throw new Error('Data not ready.');
|
|
95
94
|
|
|
96
95
|
const resourceData = data.getDataAsJson();
|
|
@@ -130,8 +129,8 @@ export function parseDataInfoResource(
|
|
|
130
129
|
|
|
131
130
|
for (const key of keys) {
|
|
132
131
|
const partKey = JSON.stringify([
|
|
133
|
-
...JSON.parse(superKey) as
|
|
134
|
-
...JSON.parse(key) as
|
|
132
|
+
...JSON.parse(superKey) as PColumnValue[],
|
|
133
|
+
...JSON.parse(key) as PColumnValue[]]);
|
|
135
134
|
parts[partKey] = superPart.traverse({ field: key, errorIfFieldNotSet: true }).resourceInfo;
|
|
136
135
|
}
|
|
137
136
|
}
|
|
@@ -146,7 +145,7 @@ export function parseDataInfoResource(
|
|
|
146
145
|
|
|
147
146
|
const parts: Record<
|
|
148
147
|
string,
|
|
149
|
-
Partial<Writable<
|
|
148
|
+
Partial<Writable<BinaryChunk<ResourceInfo>>>
|
|
150
149
|
> = {};
|
|
151
150
|
|
|
152
151
|
// parsing the structure
|
|
@@ -179,14 +178,14 @@ export function parseDataInfoResource(
|
|
|
179
178
|
return {
|
|
180
179
|
type: 'BinaryPartitioned',
|
|
181
180
|
partitionKeyLength: meta.partitionKeyLength,
|
|
182
|
-
parts: parts as Record<string,
|
|
181
|
+
parts: parts as Record<string, BinaryChunk<ResourceInfo>>,
|
|
183
182
|
};
|
|
184
183
|
} else if (resourceTypesEqual(data.resourceType, PColumnDataBinarySuperPartitioned)) {
|
|
185
184
|
const meta = resourceData as PColumnDataSuperPartitionedResourceValue;
|
|
186
185
|
|
|
187
186
|
const parts: Record<
|
|
188
187
|
string,
|
|
189
|
-
Partial<Writable<
|
|
188
|
+
Partial<Writable<BinaryChunk<ResourceInfo>>>
|
|
190
189
|
> = {};
|
|
191
190
|
for (const superKey of data.listInputFields()) {
|
|
192
191
|
const superData = data.traverse({ field: superKey, errorIfFieldNotSet: true });
|
|
@@ -198,8 +197,8 @@ export function parseDataInfoResource(
|
|
|
198
197
|
const key = field.slice(0, field.length - 6);
|
|
199
198
|
|
|
200
199
|
const partKey = JSON.stringify([
|
|
201
|
-
...JSON.parse(superKey) as
|
|
202
|
-
...JSON.parse(key) as
|
|
200
|
+
...JSON.parse(superKey) as PColumnValue[],
|
|
201
|
+
...JSON.parse(key) as PColumnValue[]]);
|
|
203
202
|
let part = parts[partKey];
|
|
204
203
|
if (part === undefined) {
|
|
205
204
|
part = {};
|
|
@@ -213,8 +212,8 @@ export function parseDataInfoResource(
|
|
|
213
212
|
const key = field.slice(0, field.length - 7);
|
|
214
213
|
|
|
215
214
|
const partKey = JSON.stringify([
|
|
216
|
-
...JSON.parse(superKey) as
|
|
217
|
-
...JSON.parse(key) as
|
|
215
|
+
...JSON.parse(superKey) as PColumnValue[],
|
|
216
|
+
...JSON.parse(key) as PColumnValue[]]);
|
|
218
217
|
let part = parts[partKey];
|
|
219
218
|
if (part === undefined) {
|
|
220
219
|
part = {};
|
|
@@ -231,19 +230,19 @@ export function parseDataInfoResource(
|
|
|
231
230
|
return {
|
|
232
231
|
type: 'BinaryPartitioned',
|
|
233
232
|
partitionKeyLength: meta.superPartitionKeyLength + meta.partitionKeyLength,
|
|
234
|
-
parts: parts as Record<string,
|
|
233
|
+
parts: parts as Record<string, BinaryChunk<ResourceInfo>>,
|
|
235
234
|
};
|
|
236
235
|
}
|
|
237
236
|
|
|
238
237
|
throw new Error(`unsupported resource type: ${resourceTypeToString(data.resourceType)}`);
|
|
239
238
|
}
|
|
240
239
|
|
|
241
|
-
export function
|
|
240
|
+
export function makeDataInfoFromPColumnValues(
|
|
242
241
|
spec: PColumnSpec,
|
|
243
242
|
data: PColumnValues,
|
|
244
|
-
):
|
|
243
|
+
): JsonDataInfo {
|
|
245
244
|
const keyLength = spec.axesSpec.length;
|
|
246
|
-
const jsonData: Record<string,
|
|
245
|
+
const jsonData: Record<string, PColumnValue> = {};
|
|
247
246
|
for (const { key, val } of data) {
|
|
248
247
|
if (key.length !== keyLength)
|
|
249
248
|
throw new Error(`inline column key length ${key.length} differs from axes count ${keyLength}`);
|
package/src/pool/driver.ts
CHANGED
|
@@ -29,14 +29,17 @@ import type {
|
|
|
29
29
|
PTableRecordSingleValueFilterV2,
|
|
30
30
|
PTableRecordFilter,
|
|
31
31
|
PColumnValues,
|
|
32
|
+
DataInfo,
|
|
32
33
|
} from '@platforma-sdk/model';
|
|
33
34
|
import {
|
|
34
35
|
mapPObjectData,
|
|
35
36
|
mapPTableDef,
|
|
36
37
|
extractAllColumns,
|
|
38
|
+
mapDataInfo,
|
|
39
|
+
isDataInfo,
|
|
37
40
|
} from '@platforma-sdk/model';
|
|
38
41
|
import { RefCountResourcePool } from './ref_count_pool';
|
|
39
|
-
import { allBlobs,
|
|
42
|
+
import { allBlobs, makeDataInfoFromPColumnValues, mapBlobs, parseDataInfoResource } from './data';
|
|
40
43
|
import { createHash } from 'node:crypto';
|
|
41
44
|
import type { MiLogger } from '@milaboratories/ts-helpers';
|
|
42
45
|
import { assertNever } from '@milaboratories/ts-helpers';
|
|
@@ -52,7 +55,7 @@ function blobKey(res: ResourceInfo): string {
|
|
|
52
55
|
return String(res.id);
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
type InternalPFrameData = PFrameDef<
|
|
58
|
+
type InternalPFrameData = PFrameDef<DataInfo<ResourceInfo>>;
|
|
56
59
|
|
|
57
60
|
const valueTypes: ValueType[] = ['Int', 'Long', 'Float', 'Double', 'String', 'Bytes'] as const;
|
|
58
61
|
|
|
@@ -258,13 +261,13 @@ type FullPTableDef = {
|
|
|
258
261
|
export interface InternalPFrameDriver extends SdkPFrameDriver {
|
|
259
262
|
/** Create a new PFrame */
|
|
260
263
|
createPFrame(
|
|
261
|
-
def: PFrameDef<PlTreeNodeAccessor | PColumnValues
|
|
264
|
+
def: PFrameDef<PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor>>,
|
|
262
265
|
ctx: ComputableCtx,
|
|
263
266
|
): PFrameHandle;
|
|
264
267
|
|
|
265
268
|
/** Create a new PTable */
|
|
266
269
|
createPTable(
|
|
267
|
-
def: PTableDef<PColumn<PlTreeNodeAccessor | PColumnValues
|
|
270
|
+
def: PTableDef<PColumn<PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor>>>,
|
|
268
271
|
ctx: ComputableCtx,
|
|
269
272
|
signal?: AbortSignal,
|
|
270
273
|
): PTableHandle;
|
|
@@ -393,14 +396,18 @@ export class PFrameDriver implements InternalPFrameDriver {
|
|
|
393
396
|
//
|
|
394
397
|
|
|
395
398
|
public createPFrame(
|
|
396
|
-
def: PFrameDef<PlTreeNodeAccessor | PColumnValues
|
|
399
|
+
def: PFrameDef<PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor>>,
|
|
397
400
|
ctx: ComputableCtx,
|
|
398
401
|
): PFrameHandle {
|
|
399
402
|
const internalData = def
|
|
400
403
|
.filter((c) => valueTypes.find((t) => t === c.spec.valueType))
|
|
401
404
|
.map((c) =>
|
|
402
405
|
mapPObjectData(c, (d) =>
|
|
403
|
-
isPlTreeNodeAccessor(d)
|
|
406
|
+
isPlTreeNodeAccessor(d)
|
|
407
|
+
? parseDataInfoResource(d)
|
|
408
|
+
: isDataInfo(d)
|
|
409
|
+
? mapDataInfo(d, (a) => a.resourceInfo)
|
|
410
|
+
: makeDataInfoFromPColumnValues(c.spec, d),
|
|
404
411
|
),
|
|
405
412
|
);
|
|
406
413
|
const res = this.pFrames.acquire(internalData);
|
|
@@ -409,7 +416,7 @@ export class PFrameDriver implements InternalPFrameDriver {
|
|
|
409
416
|
}
|
|
410
417
|
|
|
411
418
|
public createPTable(
|
|
412
|
-
def: PTableDef<PColumn<PlTreeNodeAccessor | PColumnValues
|
|
419
|
+
def: PTableDef<PColumn<PlTreeNodeAccessor | PColumnValues | DataInfo<PlTreeNodeAccessor>>>,
|
|
413
420
|
ctx: ComputableCtx,
|
|
414
421
|
signal?: AbortSignal,
|
|
415
422
|
): PTableHandle {
|
|
@@ -630,7 +637,7 @@ function stableKeyFromFullPTableDef(data: FullPTableDef): string {
|
|
|
630
637
|
return hash.digest().toString('hex');
|
|
631
638
|
}
|
|
632
639
|
|
|
633
|
-
function stableKeyFromPFrameData(data: PColumn<
|
|
640
|
+
function stableKeyFromPFrameData(data: PColumn<DataInfo<ResourceInfo>>[]): string {
|
|
634
641
|
const orderedData = [...data].map((column) =>
|
|
635
642
|
mapPObjectData(column, (r) => {
|
|
636
643
|
let result: {
|