@milaboratories/pl-model-common 1.35.0 → 1.36.1
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/dialog/index.d.ts +34 -0
- package/dist/dialog/index.d.ts.map +1 -0
- package/dist/drivers/index.d.ts +1 -1
- package/dist/drivers/pframe/data_types.cjs +1 -0
- package/dist/drivers/pframe/data_types.cjs.map +1 -1
- package/dist/drivers/pframe/data_types.d.ts +27 -1
- package/dist/drivers/pframe/data_types.d.ts.map +1 -1
- package/dist/drivers/pframe/data_types.js +1 -1
- package/dist/drivers/pframe/data_types.js.map +1 -1
- package/dist/drivers/pframe/driver.cjs.map +1 -1
- package/dist/drivers/pframe/driver.d.ts +6 -1
- package/dist/drivers/pframe/driver.d.ts.map +1 -1
- package/dist/drivers/pframe/driver.js.map +1 -1
- package/dist/drivers/pframe/index.d.ts +1 -1
- package/dist/drivers/pframe/query/query_common.d.ts +14 -28
- package/dist/drivers/pframe/query/query_common.d.ts.map +1 -1
- package/dist/drivers/pframe/query/query_data.d.ts +3 -3
- package/dist/drivers/pframe/query/query_data.d.ts.map +1 -1
- package/dist/drivers/pframe/query/query_spec.d.ts +9 -25
- package/dist/drivers/pframe/query/query_spec.d.ts.map +1 -1
- package/dist/drivers/pframe/query/utils.cjs +19 -14
- package/dist/drivers/pframe/query/utils.cjs.map +1 -1
- package/dist/drivers/pframe/query/utils.js +19 -14
- package/dist/drivers/pframe/query/utils.js.map +1 -1
- package/dist/index.cjs +10 -3
- package/dist/index.d.ts +6 -5
- package/dist/index.js +5 -5
- package/dist/services/index.cjs +1 -1
- package/dist/services/index.d.ts +3 -3
- package/dist/services/index.js +1 -1
- package/dist/services/{service_injector_factory.js → node_service_handlers.cjs} +6 -5
- package/dist/services/node_service_handlers.cjs.map +1 -0
- package/dist/services/node_service_handlers.d.ts +8 -0
- package/dist/services/node_service_handlers.d.ts.map +1 -0
- package/dist/services/{service_injector_factory.cjs → node_service_handlers.js} +6 -5
- package/dist/services/node_service_handlers.js.map +1 -0
- package/dist/services/service_declarations.cjs +48 -2
- package/dist/services/service_declarations.cjs.map +1 -1
- package/dist/services/service_declarations.d.ts +2 -0
- package/dist/services/service_declarations.d.ts.map +1 -1
- package/dist/services/service_declarations.js +48 -2
- package/dist/services/service_declarations.js.map +1 -1
- package/dist/services/service_injectors.cjs +29 -25
- package/dist/services/service_injectors.cjs.map +1 -1
- package/dist/services/service_injectors.d.ts +21 -10
- package/dist/services/service_injectors.d.ts.map +1 -1
- package/dist/services/service_injectors.js +29 -26
- package/dist/services/service_injectors.js.map +1 -1
- package/dist/services/service_types.cjs +26 -2
- package/dist/services/service_types.cjs.map +1 -1
- package/dist/services/service_types.d.ts +6 -4
- package/dist/services/service_types.d.ts.map +1 -1
- package/dist/services/service_types.js +22 -3
- package/dist/services/service_types.js.map +1 -1
- package/package.json +3 -3
- package/src/dialog/index.ts +33 -0
- package/src/drivers/pframe/data_types.ts +30 -1
- package/src/drivers/pframe/driver.ts +17 -2
- package/src/drivers/pframe/query/query_common.ts +13 -5
- package/src/drivers/pframe/query/query_data.ts +2 -3
- package/src/drivers/pframe/query/query_spec.ts +9 -33
- package/src/drivers/pframe/query/utils.ts +26 -16
- package/src/index.ts +1 -0
- package/src/services/{service_injector_factory.ts → node_service_handlers.ts} +13 -6
- package/src/services/service_declarations.ts +60 -3
- package/src/services/service_injectors.ts +50 -34
- package/src/services/service_types.ts +38 -4
- package/dist/services/service_injector_factory.cjs.map +0 -1
- package/dist/services/service_injector_factory.d.ts +0 -8
- package/dist/services/service_injector_factory.d.ts.map +0 -1
- package/dist/services/service_injector_factory.js.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/dialog/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* File filter passed to the native save dialog. Matches Electron's
|
|
4
|
+
* `FileFilter` shape so desktop runtimes can forward it verbatim.
|
|
5
|
+
*/
|
|
6
|
+
interface FileFilter {
|
|
7
|
+
name: string;
|
|
8
|
+
extensions: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Options accepted by `Dialog.showSaveDialog`. The UI supplies only a
|
|
12
|
+
* default file name; the main-process handler decides the default
|
|
13
|
+
* directory (e.g. `~/Downloads`).
|
|
14
|
+
*/
|
|
15
|
+
interface ShowSaveDialogOptions {
|
|
16
|
+
defaultFileName?: string;
|
|
17
|
+
filters?: FileFilter[];
|
|
18
|
+
title?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Result of `Dialog.showSaveDialog`. */
|
|
21
|
+
interface ShowSaveDialogResult {
|
|
22
|
+
canceled: boolean;
|
|
23
|
+
path?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* UI-facing save-dialog service. Implemented by desktop runtimes that
|
|
27
|
+
* can open a native file picker; absent in web/preview environments.
|
|
28
|
+
*/
|
|
29
|
+
interface DialogService {
|
|
30
|
+
showSaveDialog(options: ShowSaveDialogOptions): Promise<ShowSaveDialogResult>;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { DialogService, FileFilter, ShowSaveDialogOptions, ShowSaveDialogResult };
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/dialog/index.ts"],"mappings":";;AAIA;;;UAAiB,UAAA;EACf,IAAA;EACA,UAAA;AAAA;;;;;;UAQe,qBAAA;EACf,eAAA;EACA,OAAA,GAAU,UAAA;EACV,KAAA;AAAA;;UAIe,oBAAA;EACf,QAAA;EACA,IAAA;AAAA;;;;;UAOe,aAAA;EACf,cAAA,CAAe,OAAA,EAAS,qBAAA,GAAwB,OAAA,CAAQ,oBAAA;AAAA"}
|
package/dist/drivers/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { AxisQualification, BuildQueryInput, ColumnAxesWithQualifications, Delet
|
|
|
18
18
|
import { DiscoveredPColumn, DiscoveredPColumnId, createDiscoveredPColumn, createDiscoveredPColumnId, isDiscoveredPColumn, parseDiscoveredPColumnId, stringifyDiscoveredPColumnId } from "./pframe/spec/discovered_column.js";
|
|
19
19
|
import { SUniversalPColumnId, UniversalPColumnId, parseColumnId, stringifyColumnId } from "./pframe/spec/ids.js";
|
|
20
20
|
import { FilterSpec, FilterSpecLeaf, FilterSpecNode, FilterSpecOfType, FilterSpecType, InferFilterSpecCommonLeaf, InferFilterSpecCommonNode, InferFilterSpecLeaf, InferFilterSpecLeafColumn, RootFilterSpec } from "./pframe/filter_spec.js";
|
|
21
|
-
import { PTableNA, PTableShape, PTableValue, PTableValueAxis, PTableValueBranded, PTableValueData, PTableValueDataBranded, PTableValueDouble, PTableValueFloat, PTableValueInt, PTableValueLong, PTableValueString, PTableVector, PTableVectorTyped, PVectorData, PVectorDataBytes, PVectorDataDouble, PVectorDataFloat, PVectorDataInt, PVectorDataLong, PVectorDataString, PVectorDataTyped, TableRange, ValueTypeSupported, isPTableNA, pTableValue, pTableValueBranded } from "./pframe/data_types.js";
|
|
21
|
+
import { PTableDownloadCompression, PTableDownloadFormat, PTableNA, PTableShape, PTableValue, PTableValueAxis, PTableValueBranded, PTableValueData, PTableValueDataBranded, PTableValueDouble, PTableValueFloat, PTableValueInt, PTableValueLong, PTableValueString, PTableVector, PTableVectorTyped, PVectorData, PVectorDataBytes, PVectorDataDouble, PVectorDataFloat, PVectorDataInt, PVectorDataLong, PVectorDataString, PVectorDataTyped, TableRange, ValueTypeSupported, WritePTableToFsOptions, WritePTableToFsResult, isPTableNA, isValueNA, pTableValue, pTableValueBranded } from "./pframe/data_types.js";
|
|
22
22
|
import { FindColumnsRequest, FindColumnsResponse } from "./pframe/find_columns.js";
|
|
23
23
|
import { PTable } from "./pframe/table.js";
|
|
24
24
|
import { ArtificialColumnJoinEntry, CalculateTableDataRequest, CalculateTableDataResponse, ColumnJoinEntry, ConstantAxisFilter, FullJoin, FullPTableColumnData, InlineColumnJoinEntry, InnerJoin, JoinEntry, OuterJoin, PTableDef, PTableDefV2, PTableRecordFilter, PTableRecordSingleValueFilterV2, PTableSorting, SingleValueAndPredicateV2, SingleValueEqualPredicate, SingleValueGreaterOrEqualPredicate, SingleValueGreaterPredicate, SingleValueIEqualPredicate, SingleValueInSetPredicate, SingleValueIsNAPredicate, SingleValueLessOrEqualPredicate, SingleValueLessPredicate, SingleValueMatchesPredicate, SingleValueNotPredicateV2, SingleValueOrPredicateV2, SingleValuePredicateV2, SingleValueStringContainsFuzzyPredicate, SingleValueStringContainsPredicate, SingleValueStringIContainsFuzzyPredicate, SingleValueStringIContainsPredicate, SlicedColumnJoinEntry, mapJoinEntry, mapPTableDef, mapPTableDefV2, sortJoinEntry, sortPTableDef } from "./pframe/table_calculate.js";
|
|
@@ -47,6 +47,7 @@ function pTableValueBranded(column, row, options) {
|
|
|
47
47
|
//#endregion
|
|
48
48
|
exports.PTableNA = PTableNA;
|
|
49
49
|
exports.isPTableNA = isPTableNA;
|
|
50
|
+
exports.isValueNA = isValueNA;
|
|
50
51
|
exports.pTableValue = pTableValue;
|
|
51
52
|
exports.pTableValueBranded = pTableValueBranded;
|
|
52
53
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_types.cjs","names":["ValueType"],"sources":["../../../src/drivers/pframe/data_types.ts"],"sourcesContent":["import type { Branded } from \"../../branding\";\nimport { ValueType } from \"./spec/spec\";\n\nexport type PVectorDataInt = Int32Array;\nexport type PVectorDataLong = BigInt64Array;\nexport type PVectorDataFloat = Float32Array;\nexport type PVectorDataDouble = Float64Array;\nexport type PVectorDataString = (null | string)[];\nexport type PVectorDataBytes = (null | Uint8Array)[];\nexport type PVectorDataTyped<DataType extends ValueType> = DataType extends typeof ValueType.Int\n ? PVectorDataInt\n : DataType extends typeof ValueType.Long\n ? PVectorDataLong\n : DataType extends typeof ValueType.Float\n ? PVectorDataFloat\n : DataType extends typeof ValueType.Double\n ? PVectorDataDouble\n : DataType extends typeof ValueType.String\n ? PVectorDataString\n : DataType extends typeof ValueType.Bytes\n ? PVectorDataBytes\n : never;\nexport type PVectorData = PVectorDataTyped<ValueType>;\n\nexport type PTableVectorTyped<DataType extends ValueType> = {\n /** Stored data type */\n readonly type: DataType;\n\n /** Values for present positions */\n readonly data: PVectorDataTyped<DataType>;\n\n /**\n * Encoded bit array marking some elements of this vector as NA,\n * call {@link bitSet} to read the data.\n * In old desktop versions NA values are encoded as magic values in data array.\n * */\n readonly isNA?: Uint8Array;\n\n /** @deprecated Always empty. Kept for backwards compatibility with old blocks. */\n readonly absent?: Uint8Array;\n};\n/** Table column data */\nexport type PTableVector = PTableVectorTyped<ValueType>;\n\nfunction isBitSet(bitVector: Uint8Array, offset: number): boolean {\n const chunkIndex = Math.floor(offset / 8);\n const mask = 1 << (7 - (offset % 8));\n return (bitVector[chunkIndex] & mask) > 0;\n}\n\
|
|
1
|
+
{"version":3,"file":"data_types.cjs","names":["ValueType"],"sources":["../../../src/drivers/pframe/data_types.ts"],"sourcesContent":["import type { Branded } from \"../../branding\";\nimport { ValueType } from \"./spec/spec\";\n\nexport type PVectorDataInt = Int32Array;\nexport type PVectorDataLong = BigInt64Array;\nexport type PVectorDataFloat = Float32Array;\nexport type PVectorDataDouble = Float64Array;\nexport type PVectorDataString = (null | string)[];\nexport type PVectorDataBytes = (null | Uint8Array)[];\nexport type PVectorDataTyped<DataType extends ValueType> = DataType extends typeof ValueType.Int\n ? PVectorDataInt\n : DataType extends typeof ValueType.Long\n ? PVectorDataLong\n : DataType extends typeof ValueType.Float\n ? PVectorDataFloat\n : DataType extends typeof ValueType.Double\n ? PVectorDataDouble\n : DataType extends typeof ValueType.String\n ? PVectorDataString\n : DataType extends typeof ValueType.Bytes\n ? PVectorDataBytes\n : never;\nexport type PVectorData = PVectorDataTyped<ValueType>;\n\nexport type PTableVectorTyped<DataType extends ValueType> = {\n /** Stored data type */\n readonly type: DataType;\n\n /** Values for present positions */\n readonly data: PVectorDataTyped<DataType>;\n\n /**\n * Encoded bit array marking some elements of this vector as NA,\n * call {@link bitSet} to read the data.\n * In old desktop versions NA values are encoded as magic values in data array.\n * */\n readonly isNA?: Uint8Array;\n\n /** @deprecated Always empty. Kept for backwards compatibility with old blocks. */\n readonly absent?: Uint8Array;\n};\n/** Table column data */\nexport type PTableVector = PTableVectorTyped<ValueType>;\n\nfunction isBitSet(bitVector: Uint8Array, offset: number): boolean {\n const chunkIndex = Math.floor(offset / 8);\n const mask = 1 << (7 - (offset % 8));\n return (bitVector[chunkIndex] & mask) > 0;\n}\n\nexport function isValueNA(vector: PTableVector, row: number): boolean {\n if (vector.isNA) return isBitSet(vector.isNA, row);\n\n // Check for legacy magic values to support old desktop versions\n const valueType = vector.type;\n const value = vector.data[row];\n switch (valueType) {\n case ValueType.Int:\n return (value as PVectorDataInt[number]) === -2147483648;\n case ValueType.Long:\n return (value as PVectorDataLong[number]) === -9007199254740991n;\n case ValueType.Float:\n return Number.isNaN(value as PVectorDataFloat[number]);\n case ValueType.Double:\n return Number.isNaN(value as PVectorDataDouble[number]);\n case ValueType.String:\n return (value as PVectorDataString[number]) === null;\n case ValueType.Bytes:\n return (value as PVectorDataBytes[number]) === null;\n default:\n throw Error(`unsupported data type: ${valueType satisfies never}`);\n }\n}\n\nexport const PTableNA = null;\nexport type PTableNA = typeof PTableNA;\n\n/** Type guard for NA value */\nexport function isPTableNA(value: unknown): value is PTableNA {\n return value === PTableNA;\n}\n\nexport type ValueTypeSupported = Exclude<ValueType, typeof ValueType.Bytes>;\n\nexport type PTableValueInt = number;\nexport type PTableValueLong = number;\nexport type PTableValueFloat = number;\nexport type PTableValueDouble = number;\nexport type PTableValueString = string;\nexport type PTableValueData<DataType extends ValueTypeSupported> =\n DataType extends typeof ValueType.Int\n ? PTableValueInt\n : DataType extends typeof ValueType.Long\n ? PTableValueLong\n : DataType extends typeof ValueType.Float\n ? PTableValueFloat\n : DataType extends typeof ValueType.Double\n ? PTableValueDouble\n : DataType extends typeof ValueType.String\n ? PTableValueString\n : never;\nexport type PTableValueDataBranded<DataType extends ValueTypeSupported> = Branded<\n PTableValueData<DataType>,\n DataType\n>;\nexport type PTableValue<NA = PTableNA, DataType extends ValueTypeSupported = ValueTypeSupported> =\n | NA\n | PTableValueData<DataType>;\nexport type PTableValueBranded<\n NA = PTableNA,\n DataType extends ValueTypeSupported = ValueTypeSupported,\n> = NA | PTableValueDataBranded<DataType>;\n\nexport type PTableValueAxis<DataType extends ValueTypeSupported = ValueTypeSupported> =\n PTableValueData<DataType>;\n\nfunction pTableValueImpl<FillNA = PTableNA, DataType extends ValueType = ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options?: {\n na?: FillNA;\n dataType?: DataType;\n },\n) {\n const valueType = column.type;\n if (valueType === ValueType.Bytes) {\n throw Error(\"Bytes not yet supported\");\n }\n\n if (\n options &&\n \"dataType\" in options &&\n options.dataType !== undefined &&\n options.dataType !== valueType\n ) {\n throw Error(`expected column of type ${options.dataType}, got ${valueType}`);\n }\n\n if (isValueNA(column, row)) {\n return options?.na !== undefined ? options.na : PTableNA;\n }\n\n const value = column.data[row]!;\n switch (valueType) {\n case ValueType.Int:\n return value as PVectorDataInt[number];\n case ValueType.Long:\n return Number(value as PVectorDataLong[number]);\n case ValueType.Float:\n return value as PVectorDataFloat[number];\n case ValueType.Double:\n return value as PVectorDataDouble[number];\n case ValueType.String:\n return (value as PVectorDataString[number])!;\n }\n}\n\n/** Read PTableValue from PTable column at specified row */\nexport function pTableValue<DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n): DataType extends ValueTypeSupported ? PTableValue<PTableNA, DataType> : never;\nexport function pTableValue<FillNA, DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n options: {\n na: FillNA;\n },\n): DataType extends ValueTypeSupported ? PTableValue<FillNA, DataType> : never;\nexport function pTableValue<FillNA, DataType extends ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options: {\n na: FillNA;\n dataType: DataType;\n },\n): PTableValue<FillNA, DataType>;\nexport function pTableValue<FillNA = PTableNA, DataType extends ValueType = ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options?: {\n na?: FillNA;\n dataType?: DataType;\n },\n) {\n return pTableValueImpl(column, row, options);\n}\n\nexport function pTableValueBranded<DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n): DataType extends ValueTypeSupported ? PTableValueBranded<PTableNA, DataType> : never;\nexport function pTableValueBranded<FillNA, DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n options: {\n na: FillNA;\n },\n): DataType extends ValueTypeSupported ? PTableValueBranded<FillNA, DataType> : never;\nexport function pTableValueBranded<FillNA, DataType extends ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options: {\n na: FillNA;\n dataType: DataType;\n },\n): PTableValueBranded<FillNA, DataType>;\nexport function pTableValueBranded<\n FillNA = PTableNA,\n DataType extends ValueType = ValueTypeSupported,\n>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options?: {\n na?: FillNA;\n dataType?: DataType;\n },\n) {\n return pTableValueImpl(column, row, options);\n}\n\n/** Used in requests to partially retrieve table's data */\nexport type TableRange = {\n /** Index of the first record to retrieve */\n readonly offset: number;\n\n /** Block length */\n readonly length: number;\n};\n\n/** Unified information about table shape */\nexport type PTableShape = {\n /** Number of unified table columns, including all axes and PColumn values */\n columns: number;\n\n /** Number of rows */\n rows: number;\n};\n\n/** Supported formats for PTable file download. */\nexport type PTableDownloadFormat = \"csv\" | \"tsv\";\n\n/** Compression applied to the written file. */\nexport type PTableDownloadCompression = \"none\" | \"gzip\";\n\n/** Options for downloading PTable data to a file. */\nexport interface WritePTableToFsOptions {\n path: string;\n format: PTableDownloadFormat;\n columnIndices: number[];\n range?: TableRange;\n chunkSize?: number;\n includeHeader?: boolean;\n bom?: boolean;\n compression?: {\n type: \"gzip\";\n level?: number;\n };\n signal?: AbortSignal;\n}\n\n/** Result of a PTable file download. */\nexport interface WritePTableTo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AiC;EACjD,KAAKA,aAAAA,UAAU,MACb,QAAO;EACT,KAAKA,aAAAA,UAAU,OACb,QAAO;EACT,KAAKA,aAAAA,UAAU,OACb,QAAQ;;;AAwBd,SAAgB,YACd,QACA,KACA,SAIA;AACA,QAAO,gBAAgB,QAAQ,KAAK,QAAQ;;AAsB9C,SAAgB,mBAId,QACA,KACA,SAIA;AACA,QAAO,gBAAgB,QAAQ,KAAK,QAAQ"}
|
|
@@ -23,6 +23,7 @@ type PTableVectorTyped<DataType extends ValueType> = {
|
|
|
23
23
|
};
|
|
24
24
|
/** Table column data */
|
|
25
25
|
type PTableVector = PTableVectorTyped<ValueType>;
|
|
26
|
+
declare function isValueNA(vector: PTableVector, row: number): boolean;
|
|
26
27
|
declare const PTableNA: null;
|
|
27
28
|
type PTableNA = typeof PTableNA;
|
|
28
29
|
/** Type guard for NA value */
|
|
@@ -65,6 +66,31 @@ type PTableShape = {
|
|
|
65
66
|
/** Number of unified table columns, including all axes and PColumn values */columns: number; /** Number of rows */
|
|
66
67
|
rows: number;
|
|
67
68
|
};
|
|
69
|
+
/** Supported formats for PTable file download. */
|
|
70
|
+
type PTableDownloadFormat = "csv" | "tsv";
|
|
71
|
+
/** Compression applied to the written file. */
|
|
72
|
+
type PTableDownloadCompression = "none" | "gzip";
|
|
73
|
+
/** Options for downloading PTable data to a file. */
|
|
74
|
+
interface WritePTableToFsOptions {
|
|
75
|
+
path: string;
|
|
76
|
+
format: PTableDownloadFormat;
|
|
77
|
+
columnIndices: number[];
|
|
78
|
+
range?: TableRange;
|
|
79
|
+
chunkSize?: number;
|
|
80
|
+
includeHeader?: boolean;
|
|
81
|
+
bom?: boolean;
|
|
82
|
+
compression?: {
|
|
83
|
+
type: "gzip";
|
|
84
|
+
level?: number;
|
|
85
|
+
};
|
|
86
|
+
signal?: AbortSignal;
|
|
87
|
+
}
|
|
88
|
+
/** Result of a PTable file download. */
|
|
89
|
+
interface WritePTableToFsResult {
|
|
90
|
+
path: string;
|
|
91
|
+
rowsWritten: number;
|
|
92
|
+
bytesWritten: number;
|
|
93
|
+
}
|
|
68
94
|
//#endregion
|
|
69
|
-
export { PTableNA, PTableShape, PTableValue, PTableValueAxis, PTableValueBranded, PTableValueData, PTableValueDataBranded, PTableValueDouble, PTableValueFloat, PTableValueInt, PTableValueLong, PTableValueString, PTableVector, PTableVectorTyped, PVectorData, PVectorDataBytes, PVectorDataDouble, PVectorDataFloat, PVectorDataInt, PVectorDataLong, PVectorDataString, PVectorDataTyped, TableRange, ValueTypeSupported, isPTableNA, pTableValue, pTableValueBranded };
|
|
95
|
+
export { PTableDownloadCompression, PTableDownloadFormat, PTableNA, PTableShape, PTableValue, PTableValueAxis, PTableValueBranded, PTableValueData, PTableValueDataBranded, PTableValueDouble, PTableValueFloat, PTableValueInt, PTableValueLong, PTableValueString, PTableVector, PTableVectorTyped, PVectorData, PVectorDataBytes, PVectorDataDouble, PVectorDataFloat, PVectorDataInt, PVectorDataLong, PVectorDataString, PVectorDataTyped, TableRange, ValueTypeSupported, WritePTableToFsOptions, WritePTableToFsResult, isPTableNA, isValueNA, pTableValue, pTableValueBranded };
|
|
70
96
|
//# sourceMappingURL=data_types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_types.d.ts","names":[],"sources":["../../../src/drivers/pframe/data_types.ts"],"mappings":";;;;KAGY,cAAA,GAAiB,UAAA;AAAA,KACjB,eAAA,GAAkB,aAAA;AAAA,KAClB,gBAAA,GAAmB,YAAA;AAAA,KACnB,iBAAA,GAAoB,YAAA;AAAA,KACpB,iBAAA;AAAA,KACA,gBAAA,WAA2B,UAAA;AAAA,KAC3B,gBAAA,kBAAkC,SAAA,IAAa,QAAA,gBAAwB,SAAA,CAAU,GAAA,GACzF,cAAA,GACA,QAAA,gBAAwB,SAAA,CAAU,IAAA,GAChC,eAAA,GACA,QAAA,gBAAwB,SAAA,CAAU,KAAA,GAChC,gBAAA,GACA,QAAA,gBAAwB,SAAA,CAAU,MAAA,G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IACA,KAAA;EAAA;EAEF,MAAA,GAAS,WAAA;AAAA;;UAIM,qBAAA;EACf,IAAA;EACA,WAAA;EACA,YAAA;AAAA"}
|
|
@@ -45,6 +45,6 @@ function pTableValueBranded(column, row, options) {
|
|
|
45
45
|
return pTableValueImpl(column, row, options);
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
|
-
export { PTableNA, isPTableNA, pTableValue, pTableValueBranded };
|
|
48
|
+
export { PTableNA, isPTableNA, isValueNA, pTableValue, pTableValueBranded };
|
|
49
49
|
|
|
50
50
|
//# sourceMappingURL=data_types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_types.js","names":[],"sources":["../../../src/drivers/pframe/data_types.ts"],"sourcesContent":["import type { Branded } from \"../../branding\";\nimport { ValueType } from \"./spec/spec\";\n\nexport type PVectorDataInt = Int32Array;\nexport type PVectorDataLong = BigInt64Array;\nexport type PVectorDataFloat = Float32Array;\nexport type PVectorDataDouble = Float64Array;\nexport type PVectorDataString = (null | string)[];\nexport type PVectorDataBytes = (null | Uint8Array)[];\nexport type PVectorDataTyped<DataType extends ValueType> = DataType extends typeof ValueType.Int\n ? PVectorDataInt\n : DataType extends typeof ValueType.Long\n ? PVectorDataLong\n : DataType extends typeof ValueType.Float\n ? PVectorDataFloat\n : DataType extends typeof ValueType.Double\n ? PVectorDataDouble\n : DataType extends typeof ValueType.String\n ? PVectorDataString\n : DataType extends typeof ValueType.Bytes\n ? PVectorDataBytes\n : never;\nexport type PVectorData = PVectorDataTyped<ValueType>;\n\nexport type PTableVectorTyped<DataType extends ValueType> = {\n /** Stored data type */\n readonly type: DataType;\n\n /** Values for present positions */\n readonly data: PVectorDataTyped<DataType>;\n\n /**\n * Encoded bit array marking some elements of this vector as NA,\n * call {@link bitSet} to read the data.\n * In old desktop versions NA values are encoded as magic values in data array.\n * */\n readonly isNA?: Uint8Array;\n\n /** @deprecated Always empty. Kept for backwards compatibility with old blocks. */\n readonly absent?: Uint8Array;\n};\n/** Table column data */\nexport type PTableVector = PTableVectorTyped<ValueType>;\n\nfunction isBitSet(bitVector: Uint8Array, offset: number): boolean {\n const chunkIndex = Math.floor(offset / 8);\n const mask = 1 << (7 - (offset % 8));\n return (bitVector[chunkIndex] & mask) > 0;\n}\n\
|
|
1
|
+
{"version":3,"file":"data_types.js","names":[],"sources":["../../../src/drivers/pframe/data_types.ts"],"sourcesContent":["import type { Branded } from \"../../branding\";\nimport { ValueType } from \"./spec/spec\";\n\nexport type PVectorDataInt = Int32Array;\nexport type PVectorDataLong = BigInt64Array;\nexport type PVectorDataFloat = Float32Array;\nexport type PVectorDataDouble = Float64Array;\nexport type PVectorDataString = (null | string)[];\nexport type PVectorDataBytes = (null | Uint8Array)[];\nexport type PVectorDataTyped<DataType extends ValueType> = DataType extends typeof ValueType.Int\n ? PVectorDataInt\n : DataType extends typeof ValueType.Long\n ? PVectorDataLong\n : DataType extends typeof ValueType.Float\n ? PVectorDataFloat\n : DataType extends typeof ValueType.Double\n ? PVectorDataDouble\n : DataType extends typeof ValueType.String\n ? PVectorDataString\n : DataType extends typeof ValueType.Bytes\n ? PVectorDataBytes\n : never;\nexport type PVectorData = PVectorDataTyped<ValueType>;\n\nexport type PTableVectorTyped<DataType extends ValueType> = {\n /** Stored data type */\n readonly type: DataType;\n\n /** Values for present positions */\n readonly data: PVectorDataTyped<DataType>;\n\n /**\n * Encoded bit array marking some elements of this vector as NA,\n * call {@link bitSet} to read the data.\n * In old desktop versions NA values are encoded as magic values in data array.\n * */\n readonly isNA?: Uint8Array;\n\n /** @deprecated Always empty. Kept for backwards compatibility with old blocks. */\n readonly absent?: Uint8Array;\n};\n/** Table column data */\nexport type PTableVector = PTableVectorTyped<ValueType>;\n\nfunction isBitSet(bitVector: Uint8Array, offset: number): boolean {\n const chunkIndex = Math.floor(offset / 8);\n const mask = 1 << (7 - (offset % 8));\n return (bitVector[chunkIndex] & mask) > 0;\n}\n\nexport function isValueNA(vector: PTableVector, row: number): boolean {\n if (vector.isNA) return isBitSet(vector.isNA, row);\n\n // Check for legacy magic values to support old desktop versions\n const valueType = vector.type;\n const value = vector.data[row];\n switch (valueType) {\n case ValueType.Int:\n return (value as PVectorDataInt[number]) === -2147483648;\n case ValueType.Long:\n return (value as PVectorDataLong[number]) === -9007199254740991n;\n case ValueType.Float:\n return Number.isNaN(value as PVectorDataFloat[number]);\n case ValueType.Double:\n return Number.isNaN(value as PVectorDataDouble[number]);\n case ValueType.String:\n return (value as PVectorDataString[number]) === null;\n case ValueType.Bytes:\n return (value as PVectorDataBytes[number]) === null;\n default:\n throw Error(`unsupported data type: ${valueType satisfies never}`);\n }\n}\n\nexport const PTableNA = null;\nexport type PTableNA = typeof PTableNA;\n\n/** Type guard for NA value */\nexport function isPTableNA(value: unknown): value is PTableNA {\n return value === PTableNA;\n}\n\nexport type ValueTypeSupported = Exclude<ValueType, typeof ValueType.Bytes>;\n\nexport type PTableValueInt = number;\nexport type PTableValueLong = number;\nexport type PTableValueFloat = number;\nexport type PTableValueDouble = number;\nexport type PTableValueString = string;\nexport type PTableValueData<DataType extends ValueTypeSupported> =\n DataType extends typeof ValueType.Int\n ? PTableValueInt\n : DataType extends typeof ValueType.Long\n ? PTableValueLong\n : DataType extends typeof ValueType.Float\n ? PTableValueFloat\n : DataType extends typeof ValueType.Double\n ? PTableValueDouble\n : DataType extends typeof ValueType.String\n ? PTableValueString\n : never;\nexport type PTableValueDataBranded<DataType extends ValueTypeSupported> = Branded<\n PTableValueData<DataType>,\n DataType\n>;\nexport type PTableValue<NA = PTableNA, DataType extends ValueTypeSupported = ValueTypeSupported> =\n | NA\n | PTableValueData<DataType>;\nexport type PTableValueBranded<\n NA = PTableNA,\n DataType extends ValueTypeSupported = ValueTypeSupported,\n> = NA | PTableValueDataBranded<DataType>;\n\nexport type PTableValueAxis<DataType extends ValueTypeSupported = ValueTypeSupported> =\n PTableValueData<DataType>;\n\nfunction pTableValueImpl<FillNA = PTableNA, DataType extends ValueType = ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options?: {\n na?: FillNA;\n dataType?: DataType;\n },\n) {\n const valueType = column.type;\n if (valueType === ValueType.Bytes) {\n throw Error(\"Bytes not yet supported\");\n }\n\n if (\n options &&\n \"dataType\" in options &&\n options.dataType !== undefined &&\n options.dataType !== valueType\n ) {\n throw Error(`expected column of type ${options.dataType}, got ${valueType}`);\n }\n\n if (isValueNA(column, row)) {\n return options?.na !== undefined ? options.na : PTableNA;\n }\n\n const value = column.data[row]!;\n switch (valueType) {\n case ValueType.Int:\n return value as PVectorDataInt[number];\n case ValueType.Long:\n return Number(value as PVectorDataLong[number]);\n case ValueType.Float:\n return value as PVectorDataFloat[number];\n case ValueType.Double:\n return value as PVectorDataDouble[number];\n case ValueType.String:\n return (value as PVectorDataString[number])!;\n }\n}\n\n/** Read PTableValue from PTable column at specified row */\nexport function pTableValue<DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n): DataType extends ValueTypeSupported ? PTableValue<PTableNA, DataType> : never;\nexport function pTableValue<FillNA, DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n options: {\n na: FillNA;\n },\n): DataType extends ValueTypeSupported ? PTableValue<FillNA, DataType> : never;\nexport function pTableValue<FillNA, DataType extends ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options: {\n na: FillNA;\n dataType: DataType;\n },\n): PTableValue<FillNA, DataType>;\nexport function pTableValue<FillNA = PTableNA, DataType extends ValueType = ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options?: {\n na?: FillNA;\n dataType?: DataType;\n },\n) {\n return pTableValueImpl(column, row, options);\n}\n\nexport function pTableValueBranded<DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n): DataType extends ValueTypeSupported ? PTableValueBranded<PTableNA, DataType> : never;\nexport function pTableValueBranded<FillNA, DataType extends ValueType>(\n column: PTableVectorTyped<DataType>,\n row: number,\n options: {\n na: FillNA;\n },\n): DataType extends ValueTypeSupported ? PTableValueBranded<FillNA, DataType> : never;\nexport function pTableValueBranded<FillNA, DataType extends ValueTypeSupported>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options: {\n na: FillNA;\n dataType: DataType;\n },\n): PTableValueBranded<FillNA, DataType>;\nexport function pTableValueBranded<\n FillNA = PTableNA,\n DataType extends ValueType = ValueTypeSupported,\n>(\n column: PTableVectorTyped<ValueType>,\n row: number,\n options?: {\n na?: FillNA;\n dataType?: DataType;\n },\n) {\n return pTableValueImpl(column, row, options);\n}\n\n/** Used in requests to partially retrieve table's data */\nexport type TableRange = {\n /** Index of the first record to retrieve */\n readonly offset: number;\n\n /** Block length */\n readonly length: number;\n};\n\n/** Unified information about table shape */\nexport type PTableShape = {\n /** Number of unified table columns, including all axes and PColumn values */\n columns: number;\n\n /** Number of rows */\n rows: number;\n};\n\n/** Supported formats for PTable file download. */\nexport type PTableDownloadFormat = \"csv\" | \"tsv\";\n\n/** Compression applied to the written file. */\nexport type PTableDownloadCompression = \"none\" | \"gzip\";\n\n/** Options for downloading PTable data to a file. */\nexport interface WritePTableToFsOptions {\n path: string;\n format: PTableDownloadFormat;\n columnIndices: number[];\n range?: TableRange;\n chunkSize?: number;\n includeHeader?: boolean;\n bom?: boolean;\n compression?: {\n type: \"gzip\";\n level?: number;\n };\n signal?: AbortSignal;\n}\n\n/** Result of a PTable file download. */\nexport interface WritePTableToFsResult {\n path: string;\n rowsWritten: number;\n bytesWritten: number;\n}\n"],"mappings":";;AA4CA,SAAS,SAAS,WAAuB,QAAyB;CAChE,MAAM,aAAa,KAAK,MAAM,SAAS,EAAE;CACzC,MAAM,OAAO,KAAM,IAAK,SAAS;AACjC,SAAQ,UAAU,cAAc,QAAQ;;AAG1C,SAAgB,UAAU,QAAsB,KAAsB;AACpE,KAAI,OAAO,KAAM,QAAO,SAAS,OAAO,MAAM,IAAI;CAGlD,MAAM,YAAY,OAAO;CACzB,MAAM,QAAQ,OAAO,KAAK;AAC1B,SAAQ,WAAR;EACE,KAAK,UAAU,IACb,QAAQ,UAAqC;EAC/C,KAAK,UAAU,KACb,QAAQ,UAAsC,CAAC;EACjD,KAAK,UAAU,MACb,QAAO,OAAO,MAAM,MAAkC;EACxD,KAAK,UAAU,OACb,QAAO,OAAO,MAAM,MAAmC;EACzD,KAAK,UAAU,OACb,QAAQ,UAAwC;EAClD,KAAK,UAAU,MACb,QAAQ,UAAuC;EACjD,QACE,OAAM,MAAM,0BAA0B,YAA4B;;;AAIxE,MAAa,WAAW;;AAIxB,SAAgB,WAAW,OAAmC;AAC5D,QAAO,UAAA;;AAqCT,SAAS,gBACP,QACA,KACA,SAIA;CACA,MAAM,YAAY,OAAO;AACzB,KAAI,cAAc,UAAU,MAC1B,OAAM,MAAM,0BAA0B;AAGxC,KACE,WACA,cAAc,WACd,QAAQ,aAAa,KAAA,KACrB,QAAQ,aAAa,UAErB,OAAM,MAAM,2BAA2B,QAAQ,SAAS,QAAQ,YAAY;AAG9E,KAAI,UAAU,QAAQ,IAAI,CACxB,QAAO,SAAS,OAAO,KAAA,IAAY,QAAQ,KAAA;CAG7C,MAAM,QAAQ,OAAO,KAAK;AAC1B,SAAQ,WAAR;EACE,KAAK,UAAU,IACb,QAAO;EACT,KAAK,UAAU,KACb,QAAO,OAAO,MAAiC;EACjD,KAAK,UAAU,MACb,QAAO;EACT,KAAK,UAAU,OACb,QAAO;EACT,KAAK,UAAU,OACb,QAAQ;;;AAwBd,SAAgB,YACd,QACA,KACA,SAIA;AACA,QAAO,gBAAgB,QAAQ,KAAK,QAAQ;;AAsB9C,SAAgB,mBAId,QACA,KACA,SAIA;AACA,QAAO,gBAAgB,QAAQ,KAAK,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.cjs","names":[],"sources":["../../../src/drivers/pframe/driver.ts"],"sourcesContent":["import type { Branded } from \"../../branding\";\nimport type { PTable } from \"./table\";\nimport type { PFrame, PFrameDef } from \"./pframe\";\nimport type { PColumn } from \"./spec/spec\";\nimport type { PColumnValues, DataInfo } from \"./data_info\";\nimport type { PTableDef, PTableDefV2 } from \"./table_calculate\";\nimport type { AddParameterToAllMethods } from \"./type_util\";\nimport type {
|
|
1
|
+
{"version":3,"file":"driver.cjs","names":[],"sources":["../../../src/drivers/pframe/driver.ts"],"sourcesContent":["import type { Branded } from \"../../branding\";\nimport type { PTable } from \"./table\";\nimport type { PFrame, PFrameDef } from \"./pframe\";\nimport type { PColumn } from \"./spec/spec\";\nimport type { PColumnValues, DataInfo } from \"./data_info\";\nimport type { PTableDef, PTableDefV2 } from \"./table_calculate\";\nimport type { AddParameterToAllMethods } from \"./type_util\";\nimport type {\n WritePTableToFsOptions,\n WritePTableToFsResult,\n PTableShape,\n PTableVector,\n TableRange,\n} from \"./data_types\";\nimport type { FindColumnsRequest, FindColumnsResponse } from \"./find_columns\";\nimport type { PObjectId } from \"../../pool\";\nimport type { PColumnIdAndSpec, PColumnSpec } from \"./spec/spec\";\nimport type { CalculateTableDataRequest, CalculateTableDataResponse } from \"./table_calculate\";\nimport type { UniqueValuesRequest, UniqueValuesResponse } from \"./unique_values\";\nimport type { PTableColumnSpec } from \"./table_common\";\n\n/** PFrame handle */\nexport type PFrameHandle = Branded<string, \"PFrame\">;\n\n/** PFrame handle */\nexport type PTableHandle = Branded<string, \"PTable\">;\n\n/** Model-side PFrame service — creates frames/tables from column definitions. */\nexport interface PFrameModelDriver<Col = PColumn<string | PColumnValues | DataInfo<string>>> {\n createPFrame(def: PFrameDef<Col>): PFrameHandle;\n createPTable(def: PTableDef<Col>): PTableHandle;\n createPTableV2(def: PTableDefV2<Col>): PTableHandle;\n}\n\n/** Allows to access main data layer features of platforma */\nexport interface PFrameDriver {\n //\n // PFrame methods\n //\n\n /**\n * Finds columns given filtering criteria on column name, annotations etc.\n * and a set of axes ids to find only columns with compatible specs.\n * */\n findColumns(handle: PFrameHandle, request: FindColumnsRequest): Promise<FindColumnsResponse>;\n\n /** Retrieve single column spec */\n getColumnSpec(handle: PFrameHandle, columnId: PObjectId): Promise<PColumnSpec | null>;\n\n /** Retrieve information about all columns currently added to the PFrame */\n listColumns(handle: PFrameHandle): Promise<PColumnIdAndSpec[]>;\n\n /** Calculates data for the table and returns complete data representation of it */\n calculateTableData(\n handle: PFrameHandle,\n request: CalculateTableDataRequest<PObjectId>,\n range?: TableRange,\n ): Promise<CalculateTableDataResponse>;\n\n /** Calculate set of unique values for a specific axis for the filtered set of records */\n getUniqueValues(\n handle: PFrameHandle,\n request: UniqueValuesRequest,\n ): Promise<UniqueValuesResponse>;\n\n //\n // PTable methods\n //\n\n /** Unified table shape */\n getShape(handle: PTableHandle): Promise<PTableShape>;\n\n /**\n * Returns ordered array of table axes specs (primary key \"columns\" in SQL\n * terms) and data column specs (regular \"columns\" in SQL terms).\n *\n * Data for a specific table column can be retrieved using unified indexing\n * corresponding to elements in this array.\n *\n * Axes are always listed first.\n * */\n getSpec(handle: PTableHandle): Promise<PTableColumnSpec[]>;\n\n /**\n * Retrieve the data from the table. To retrieve only data required, it can be\n * sliced both horizontally ({@link columnIndices}) and vertically\n * ({@link range}).\n *\n * @param columnIndices unified indices of columns to be retrieved\n * @param range optionally limit the range of records to retrieve\n * */\n getData(\n handle: PTableHandle,\n columnIndices: number[],\n range?: TableRange,\n ): Promise<PTableVector[]>;\n\n /**\n * Stream the table to a file at the given path. Caller is responsible\n * for producing the destination path (e.g. via the `Dialog` service).\n */\n writePTableToFs(\n handle: PTableHandle,\n options: WritePTableToFsOptions,\n ): Promise<WritePTableToFsResult>;\n}\n\n//\n// The following keeps the PFrame driver from above to be in sync with\n// PFrame and PTable interfaces.\n//\n\ntype ExpectedPFrameDriverTypeF = AddParameterToAllMethods<PFrame, [handle: PFrameHandle]>;\ntype ExpectedPFrameDriverTypeT = AddParameterToAllMethods<PTable, [handle: PTableHandle]>;\ntype ExpectedPFrameDriverType = ExpectedPFrameDriverTypeF & ExpectedPFrameDriverTypeT;\n\ntype TypeEqualityGuard<A, B> = Exclude<A, B> | Exclude<B, A>;\nfunction assert<_T extends never>() {}\n\nassert<TypeEqualityGuard<Omit<PFrameDriver, \"writePTableToFs\">, ExpectedPFrameDriverType>>();\n"],"mappings":";AAqHA,SAAS,SAA2B;AAEpC,QAA4F"}
|
|
@@ -2,7 +2,7 @@ import { Branded } from "../../branding.js";
|
|
|
2
2
|
import { PColumn, PColumnIdAndSpec, PColumnSpec } from "./spec/spec.js";
|
|
3
3
|
import { DataInfo, PColumnValues } from "./data_info.js";
|
|
4
4
|
import { PTableColumnSpec } from "./table_common.js";
|
|
5
|
-
import { PTableShape, PTableVector, TableRange } from "./data_types.js";
|
|
5
|
+
import { PTableShape, PTableVector, TableRange, WritePTableToFsOptions, WritePTableToFsResult } from "./data_types.js";
|
|
6
6
|
import { FindColumnsRequest, FindColumnsResponse } from "./find_columns.js";
|
|
7
7
|
import { CalculateTableDataRequest, CalculateTableDataResponse, PTableDef, PTableDefV2 } from "./table_calculate.js";
|
|
8
8
|
import { UniqueValuesRequest, UniqueValuesResponse } from "./unique_values.js";
|
|
@@ -56,6 +56,11 @@ interface PFrameDriver {
|
|
|
56
56
|
* @param range optionally limit the range of records to retrieve
|
|
57
57
|
* */
|
|
58
58
|
getData(handle: PTableHandle, columnIndices: number[], range?: TableRange): Promise<PTableVector[]>;
|
|
59
|
+
/**
|
|
60
|
+
* Stream the table to a file at the given path. Caller is responsible
|
|
61
|
+
* for producing the destination path (e.g. via the `Dialog` service).
|
|
62
|
+
*/
|
|
63
|
+
writePTableToFs(handle: PTableHandle, options: WritePTableToFsOptions): Promise<WritePTableToFsResult>;
|
|
59
64
|
}
|
|
60
65
|
//#endregion
|
|
61
66
|
export { PFrameDriver, PFrameHandle, PFrameModelDriver, PTableHandle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","names":[],"sources":["../../../src/drivers/pframe/driver.ts"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"driver.d.ts","names":[],"sources":["../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AAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.js","names":[],"sources":["../../../src/drivers/pframe/driver.ts"],"sourcesContent":["import type { Branded } from \"../../branding\";\nimport type { PTable } from \"./table\";\nimport type { PFrame, PFrameDef } from \"./pframe\";\nimport type { PColumn } from \"./spec/spec\";\nimport type { PColumnValues, DataInfo } from \"./data_info\";\nimport type { PTableDef, PTableDefV2 } from \"./table_calculate\";\nimport type { AddParameterToAllMethods } from \"./type_util\";\nimport type {
|
|
1
|
+
{"version":3,"file":"driver.js","names":[],"sources":["../../../src/drivers/pframe/driver.ts"],"sourcesContent":["import type { Branded } from \"../../branding\";\nimport type { PTable } from \"./table\";\nimport type { PFrame, PFrameDef } from \"./pframe\";\nimport type { PColumn } from \"./spec/spec\";\nimport type { PColumnValues, DataInfo } from \"./data_info\";\nimport type { PTableDef, PTableDefV2 } from \"./table_calculate\";\nimport type { AddParameterToAllMethods } from \"./type_util\";\nimport type {\n WritePTableToFsOptions,\n WritePTableToFsResult,\n PTableShape,\n PTableVector,\n TableRange,\n} from \"./data_types\";\nimport type { FindColumnsRequest, FindColumnsResponse } from \"./find_columns\";\nimport type { PObjectId } from \"../../pool\";\nimport type { PColumnIdAndSpec, PColumnSpec } from \"./spec/spec\";\nimport type { CalculateTableDataRequest, CalculateTableDataResponse } from \"./table_calculate\";\nimport type { UniqueValuesRequest, UniqueValuesResponse } from \"./unique_values\";\nimport type { PTableColumnSpec } from \"./table_common\";\n\n/** PFrame handle */\nexport type PFrameHandle = Branded<string, \"PFrame\">;\n\n/** PFrame handle */\nexport type PTableHandle = Branded<string, \"PTable\">;\n\n/** Model-side PFrame service — creates frames/tables from column definitions. */\nexport interface PFrameModelDriver<Col = PColumn<string | PColumnValues | DataInfo<string>>> {\n createPFrame(def: PFrameDef<Col>): PFrameHandle;\n createPTable(def: PTableDef<Col>): PTableHandle;\n createPTableV2(def: PTableDefV2<Col>): PTableHandle;\n}\n\n/** Allows to access main data layer features of platforma */\nexport interface PFrameDriver {\n //\n // PFrame methods\n //\n\n /**\n * Finds columns given filtering criteria on column name, annotations etc.\n * and a set of axes ids to find only columns with compatible specs.\n * */\n findColumns(handle: PFrameHandle, request: FindColumnsRequest): Promise<FindColumnsResponse>;\n\n /** Retrieve single column spec */\n getColumnSpec(handle: PFrameHandle, columnId: PObjectId): Promise<PColumnSpec | null>;\n\n /** Retrieve information about all columns currently added to the PFrame */\n listColumns(handle: PFrameHandle): Promise<PColumnIdAndSpec[]>;\n\n /** Calculates data for the table and returns complete data representation of it */\n calculateTableData(\n handle: PFrameHandle,\n request: CalculateTableDataRequest<PObjectId>,\n range?: TableRange,\n ): Promise<CalculateTableDataResponse>;\n\n /** Calculate set of unique values for a specific axis for the filtered set of records */\n getUniqueValues(\n handle: PFrameHandle,\n request: UniqueValuesRequest,\n ): Promise<UniqueValuesResponse>;\n\n //\n // PTable methods\n //\n\n /** Unified table shape */\n getShape(handle: PTableHandle): Promise<PTableShape>;\n\n /**\n * Returns ordered array of table axes specs (primary key \"columns\" in SQL\n * terms) and data column specs (regular \"columns\" in SQL terms).\n *\n * Data for a specific table column can be retrieved using unified indexing\n * corresponding to elements in this array.\n *\n * Axes are always listed first.\n * */\n getSpec(handle: PTableHandle): Promise<PTableColumnSpec[]>;\n\n /**\n * Retrieve the data from the table. To retrieve only data required, it can be\n * sliced both horizontally ({@link columnIndices}) and vertically\n * ({@link range}).\n *\n * @param columnIndices unified indices of columns to be retrieved\n * @param range optionally limit the range of records to retrieve\n * */\n getData(\n handle: PTableHandle,\n columnIndices: number[],\n range?: TableRange,\n ): Promise<PTableVector[]>;\n\n /**\n * Stream the table to a file at the given path. Caller is responsible\n * for producing the destination path (e.g. via the `Dialog` service).\n */\n writePTableToFs(\n handle: PTableHandle,\n options: WritePTableToFsOptions,\n ): Promise<WritePTableToFsResult>;\n}\n\n//\n// The following keeps the PFrame driver from above to be in sync with\n// PFrame and PTable interfaces.\n//\n\ntype ExpectedPFrameDriverTypeF = AddParameterToAllMethods<PFrame, [handle: PFrameHandle]>;\ntype ExpectedPFrameDriverTypeT = AddParameterToAllMethods<PTable, [handle: PTableHandle]>;\ntype ExpectedPFrameDriverType = ExpectedPFrameDriverTypeF & ExpectedPFrameDriverTypeT;\n\ntype TypeEqualityGuard<A, B> = Exclude<A, B> | Exclude<B, A>;\nfunction assert<_T extends never>() {}\n\nassert<TypeEqualityGuard<Omit<PFrameDriver, \"writePTableToFs\">, ExpectedPFrameDriverType>>();\n"],"mappings":";AAqHA,SAAS,SAA2B;AAEpC,QAA4F"}
|
|
@@ -13,7 +13,7 @@ import { AxisQualification, BuildQueryInput, ColumnAxesWithQualifications, Delet
|
|
|
13
13
|
import { DiscoveredPColumn, DiscoveredPColumnId, createDiscoveredPColumn, createDiscoveredPColumnId, isDiscoveredPColumn, parseDiscoveredPColumnId, stringifyDiscoveredPColumnId } from "./spec/discovered_column.js";
|
|
14
14
|
import { SUniversalPColumnId, UniversalPColumnId, parseColumnId, stringifyColumnId } from "./spec/ids.js";
|
|
15
15
|
import { FilterSpec, FilterSpecLeaf, FilterSpecNode, FilterSpecOfType, FilterSpecType, InferFilterSpecCommonLeaf, InferFilterSpecCommonNode, InferFilterSpecLeaf, InferFilterSpecLeafColumn, RootFilterSpec } from "./filter_spec.js";
|
|
16
|
-
import { PTableNA, PTableShape, PTableValue, PTableValueAxis, PTableValueBranded, PTableValueData, PTableValueDataBranded, PTableValueDouble, PTableValueFloat, PTableValueInt, PTableValueLong, PTableValueString, PTableVector, PTableVectorTyped, PVectorData, PVectorDataBytes, PVectorDataDouble, PVectorDataFloat, PVectorDataInt, PVectorDataLong, PVectorDataString, PVectorDataTyped, TableRange, ValueTypeSupported, isPTableNA, pTableValue, pTableValueBranded } from "./data_types.js";
|
|
16
|
+
import { PTableDownloadCompression, PTableDownloadFormat, PTableNA, PTableShape, PTableValue, PTableValueAxis, PTableValueBranded, PTableValueData, PTableValueDataBranded, PTableValueDouble, PTableValueFloat, PTableValueInt, PTableValueLong, PTableValueString, PTableVector, PTableVectorTyped, PVectorData, PVectorDataBytes, PVectorDataDouble, PVectorDataFloat, PVectorDataInt, PVectorDataLong, PVectorDataString, PVectorDataTyped, TableRange, ValueTypeSupported, WritePTableToFsOptions, WritePTableToFsResult, isPTableNA, isValueNA, pTableValue, pTableValueBranded } from "./data_types.js";
|
|
17
17
|
import { FindColumnsRequest, FindColumnsResponse } from "./find_columns.js";
|
|
18
18
|
import { PTable } from "./table.js";
|
|
19
19
|
import { ArtificialColumnJoinEntry, CalculateTableDataRequest, CalculateTableDataResponse, ColumnJoinEntry, ConstantAxisFilter, FullJoin, FullPTableColumnData, InlineColumnJoinEntry, InnerJoin, JoinEntry, OuterJoin, PTableDef, PTableDefV2, PTableRecordFilter, PTableRecordSingleValueFilterV2, PTableSorting, SingleValueAndPredicateV2, SingleValueEqualPredicate, SingleValueGreaterOrEqualPredicate, SingleValueGreaterPredicate, SingleValueIEqualPredicate, SingleValueInSetPredicate, SingleValueIsNAPredicate, SingleValueLessOrEqualPredicate, SingleValueLessPredicate, SingleValueMatchesPredicate, SingleValueNotPredicateV2, SingleValueOrPredicateV2, SingleValuePredicateV2, SingleValueStringContainsFuzzyPredicate, SingleValueStringContainsPredicate, SingleValueStringIContainsFuzzyPredicate, SingleValueStringIContainsPredicate, SlicedColumnJoinEntry, mapJoinEntry, mapPTableDef, mapPTableDefV2, sortJoinEntry, sortPTableDef } from "./table_calculate.js";
|
|
@@ -484,28 +484,6 @@ type InferBooleanExpressionUnion<E> = [E extends ExprNumericComparison<unknown>
|
|
|
484
484
|
}> : never, E extends ExprIsIn<unknown, string | number> ? Extract<E, {
|
|
485
485
|
type: "isIn";
|
|
486
486
|
}> : never][number];
|
|
487
|
-
/**
|
|
488
|
-
* Selector for referencing an axis in queries.
|
|
489
|
-
*
|
|
490
|
-
* Used to identify a specific axis dimension in operations like:
|
|
491
|
-
* - Sorting by axis values
|
|
492
|
-
* - Partitioning for window functions
|
|
493
|
-
* - Filtering/slicing axes
|
|
494
|
-
*
|
|
495
|
-
* @template A - Axis identifier type (typically string name or numeric index)
|
|
496
|
-
*
|
|
497
|
-
* @example
|
|
498
|
-
* // Select axis by name
|
|
499
|
-
* { type: 'axis', id: 'sample' }
|
|
500
|
-
*
|
|
501
|
-
* // Select axis by index
|
|
502
|
-
* { type: 'axis', id: 0 }
|
|
503
|
-
*/
|
|
504
|
-
interface QueryAxisSelector<A> {
|
|
505
|
-
type: "axis";
|
|
506
|
-
/** Axis identifier (name or index depending on context) */
|
|
507
|
-
id: A;
|
|
508
|
-
}
|
|
509
487
|
/**
|
|
510
488
|
* Left outer join query operation.
|
|
511
489
|
*
|
|
@@ -554,23 +532,31 @@ interface QueryOuterJoin<JE extends QueryJoinEntry<unknown>> {
|
|
|
554
532
|
* @template A - Axis selector type
|
|
555
533
|
*
|
|
556
534
|
* @example
|
|
557
|
-
* //
|
|
535
|
+
* // Spec layer: axisSelector is a SingleAxisSelector.
|
|
558
536
|
* {
|
|
559
537
|
* type: 'sliceAxes',
|
|
560
538
|
* input: fullDataQuery,
|
|
561
539
|
* axisFilters: [
|
|
562
|
-
* {
|
|
563
|
-
* {
|
|
540
|
+
* { axisSelector: { name: 'sample' }, constant: 'Sample1' },
|
|
541
|
+
* { axisSelector: { name: 'condition' }, constant: 'Treatment' }
|
|
564
542
|
* ]
|
|
565
543
|
* }
|
|
544
|
+
*
|
|
545
|
+
* @example
|
|
546
|
+
* // Data layer: axisSelector is the axis index.
|
|
547
|
+
* {
|
|
548
|
+
* type: 'sliceAxes',
|
|
549
|
+
* input: fullDataQuery,
|
|
550
|
+
* axisFilters: [{ axisSelector: 0, constant: 'Sample1' }]
|
|
551
|
+
* }
|
|
566
552
|
*/
|
|
567
|
-
interface QuerySliceAxes<Q, A
|
|
553
|
+
interface QuerySliceAxes<Q, A> {
|
|
568
554
|
type: "sliceAxes";
|
|
569
555
|
/** Input query to slice */
|
|
570
556
|
input: Q;
|
|
571
557
|
/** List of axis filters to apply (at least one required) */
|
|
572
558
|
axisFilters: {
|
|
573
|
-
/**
|
|
559
|
+
/** Axis to filter. `SingleAxisSelector` at the spec layer; axis index at the data layer. */axisSelector: A; /** The constant value to filter the axis to */
|
|
574
560
|
constant: string | number;
|
|
575
561
|
}[];
|
|
576
562
|
}
|
|
@@ -832,5 +818,5 @@ interface QueryLinkerJoin<L, JE extends QueryJoinEntry<unknown>> {
|
|
|
832
818
|
secondary: JE[];
|
|
833
819
|
}
|
|
834
820
|
//#endregion
|
|
835
|
-
export { ExprAxisRef, ExprColumnRef, ExprConstant, ExprIfNull, ExprIsIn, ExprIsNull, ExprLogicalUnary, ExprLogicalVariadic, ExprNumericBinary, ExprNumericComparison, ExprNumericUnary, ExprStringContains, ExprStringContainsFuzzy, ExprStringEquals, ExprStringRegex, InferBooleanExpressionUnion,
|
|
821
|
+
export { ExprAxisRef, ExprColumnRef, ExprConstant, ExprIfNull, ExprIsIn, ExprIsNull, ExprLogicalUnary, ExprLogicalVariadic, ExprNumericBinary, ExprNumericComparison, ExprNumericUnary, ExprStringContains, ExprStringContainsFuzzy, ExprStringEquals, ExprStringRegex, InferBooleanExpressionUnion, QueryColumn, QueryFilter, QueryInlineColumn, QueryJoinEntry, QueryLinkerJoin, QueryOuterJoin, QuerySliceAxes, QuerySort, QuerySparseToDenseColumn, QuerySymmetricJoin, TypeSpec };
|
|
836
822
|
//# sourceMappingURL=query_common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query_common.d.ts","names":[],"sources":["../../../../src/drivers/pframe/query/query_common.ts"],"mappings":";;;;;;;;AAYA;;KAAY,QAAA;EAIc,mEAFxB,IAAA,EAAM,aAAA,IAAA;EAEN,OAAA,EAAS,eAAA;AAAA;;;AAuBX;;;;;AAyBA;;;;;AAgBA;;;;;AAkCA;KA3EY,mBAAA;;;;AAgGZ;;;;;;;;;;KAvEY,oBAAA;;;;;;;;;;;;AA6HZ;;;KA7GY,wBAAA;;;;;;;;;;;;;;;;AA2KZ;KAzIY,YAA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AA,EAAQ,CAAA;;EAER,SAAA,EAAW,EAAA;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExprAxisRef, ExprColumnRef, ExprConstant, ExprIfNull, ExprIsIn, ExprIsNull, ExprLogicalUnary, ExprLogicalVariadic, ExprNumericBinary, ExprNumericComparison, ExprNumericUnary, ExprStringContains, ExprStringContainsFuzzy, ExprStringEquals, ExprStringRegex, InferBooleanExpressionUnion,
|
|
1
|
+
import { ExprAxisRef, ExprColumnRef, ExprConstant, ExprIfNull, ExprIsIn, ExprIsNull, ExprLogicalUnary, ExprLogicalVariadic, ExprNumericBinary, ExprNumericComparison, ExprNumericUnary, ExprStringContains, ExprStringContainsFuzzy, ExprStringEquals, ExprStringRegex, InferBooleanExpressionUnion, QueryColumn, QueryFilter, QueryInlineColumn, QueryJoinEntry, QueryLinkerJoin, QueryOuterJoin, QuerySliceAxes, QuerySort, QuerySparseToDenseColumn, QuerySymmetricJoin, TypeSpec } from "./query_common.js";
|
|
2
2
|
import { PObjectId } from "../../../pool/spec.js";
|
|
3
3
|
//#region src/drivers/pframe/query/query_data.d.ts
|
|
4
4
|
/**
|
|
@@ -9,7 +9,7 @@ import { PObjectId } from "../../../pool/spec.js";
|
|
|
9
9
|
*/
|
|
10
10
|
type ColumnIdAndTypeSpec = {
|
|
11
11
|
/** Unique identifier of the column */id: PObjectId; /** Type specification defining axes and column types */
|
|
12
|
-
|
|
12
|
+
spec: TypeSpec;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Join entry for data layer queries.
|
|
@@ -53,7 +53,7 @@ type DataQueryLinkerJoinLinker = {
|
|
|
53
53
|
/** @see QueryLinkerJoin */
|
|
54
54
|
type DataQueryLinkerJoin = QueryLinkerJoin<DataQueryLinkerJoinLinker, DataQueryJoinEntry>;
|
|
55
55
|
/** @see QuerySliceAxes */
|
|
56
|
-
type DataQuerySliceAxes = QuerySliceAxes<DataQuery,
|
|
56
|
+
type DataQuerySliceAxes = QuerySliceAxes<DataQuery, number>;
|
|
57
57
|
/** @see QuerySort */
|
|
58
58
|
type DataQuerySort = QuerySort<DataQuery, DataQueryExpression>;
|
|
59
59
|
/** @see QueryFilter */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query_data.d.ts","names":[],"sources":["../../../../src/drivers/pframe/query/query_data.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"query_data.d.ts","names":[],"sources":["../../../../src/drivers/pframe/query/query_data.ts"],"mappings":";;;;;;AA6BwB;;;KAQnB,mBAAA;EAEH,sCAAA,EAAA,EAAI,SAAA,EAEJ;EAAA,IAAA,EAAM,QAAA;AAAA;;AAeR;;;;;;;;;AAMA;;UANiB,kBAAA,SAA2B,cAAA,CAAe,SAAA;EAM7B;EAJ5B,WAAA;AAAA;;KAIU,eAAA,GAAkB,WAAA;;KAElB,qBAAA,GAAwB,iBAAA,CAAkB,mBAAA;AAEtD;AAAA,KAAY,4BAAA,GAA+B,wBAAA,CAAyB,SAAA,EAAW,mBAAA;;KAEnE,sBAAA,GAAyB,kBAAA,CAAmB,kBAAA;;KAE5C,kBAAA,GAAqB,cAAA,CAAe,kBAAA;;;;;;;;AAFhD;KAWY,yBAAA;iCAEV,MAAA,EAAQ,SAAA,EAbgE;EAexE,WAAA,YAb4B;EAe5B,kBAAA;AAAA;;KAGU,mBAAA,GAAsB,eAAA,CAAgB,yBAAA,EAA2B,kBAAA;;KAEjE,kBAAA,GAAqB,cAAA,CAAe,SAAA;;KAEpC,aAAA,GAAgB,SAAA,CAAU,SAAA,EAAW,mBAAA;;KAErC,eAAA,GAAkB,WAAA,CAAY,SAAA,EAAW,0BAAA;;;;AANrD;;;;;;;;KAmBY,SAAA,GACR,eAAA,GACA,qBAAA,GACA,4BAAA,GACA,sBAAA,GACA,kBAAA,GACA,mBAAA,GACA,kBAAA,GACA,aAAA,GACA,eAAA;;KAGQ,eAAA,GAAkB,WAAA;;KAElB,iBAAA,GAAoB,aAAA;AAAA,KAEpB,mBAAA,GACR,iBAAA,GACA,eAAA,GACA,YAAA,GACA,iBAAA,CAAkB,mBAAA,IAClB,qBAAA,CAAsB,mBAAA,IACtB,gBAAA,CAAiB,mBAAA,IACjB,gBAAA,CAAiB,mBAAA,IACjB,kBAAA,CAAmB,mBAAA,IACnB,eAAA,CAAgB,mBAAA,IAChB,uBAAA,CAAwB,mBAAA,IACxB,UAAA,CAAW,mBAAA,IACX,UAAA,CAAW,mBAAA,IACX,gBAAA,CAAiB,mBAAA,IACjB,mBAAA,CAAoB,mBAAA,IACpB,QAAA,CAAS,mBAAA,YACT,QAAA,CAAS,mBAAA;AAAA,KAED,0BAAA,GAA6B,2BAAA,CAA4B,mBAAA"}
|
|
@@ -1,44 +1,28 @@
|
|
|
1
|
-
import { Domain, PColumnIdAndSpec
|
|
1
|
+
import { Domain, PColumnIdAndSpec } from "../spec/spec.js";
|
|
2
2
|
import { SingleAxisSelector } from "../spec/selectors.js";
|
|
3
|
-
import { ExprAxisRef, ExprColumnRef, ExprConstant, ExprIfNull, ExprIsIn, ExprIsNull, ExprLogicalUnary, ExprLogicalVariadic, ExprNumericBinary, ExprNumericComparison, ExprNumericUnary, ExprStringContains, ExprStringContainsFuzzy, ExprStringEquals, ExprStringRegex, InferBooleanExpressionUnion,
|
|
3
|
+
import { ExprAxisRef, ExprColumnRef, ExprConstant, ExprIfNull, ExprIsIn, ExprIsNull, ExprLogicalUnary, ExprLogicalVariadic, ExprNumericBinary, ExprNumericComparison, ExprNumericUnary, ExprStringContains, ExprStringContainsFuzzy, ExprStringEquals, ExprStringRegex, InferBooleanExpressionUnion, QueryColumn, QueryFilter, QueryInlineColumn, QueryJoinEntry, QueryLinkerJoin, QueryOuterJoin, QuerySliceAxes, QuerySort, QuerySparseToDenseColumn, QuerySymmetricJoin } from "./query_common.js";
|
|
4
4
|
import { PObjectId } from "../../../pool/spec.js";
|
|
5
5
|
//#region src/drivers/pframe/query/query_spec.d.ts
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Pairs a column ID with its full PColumnSpec.
|
|
10
|
-
* Used in spec layer to carry column specification alongside references.
|
|
11
|
-
*/
|
|
12
|
-
type ColumnIdAndSpec = {
|
|
13
|
-
/** Unique identifier of the column */id: PObjectId; /** Full column specification including axes and value type */
|
|
14
|
-
spec: PColumnSpec;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Join entry for spec layer queries.
|
|
18
|
-
*
|
|
19
|
-
* Extends the base join entry with axis qualifications.
|
|
20
|
-
* Qualifications specify additional domain constraints for each axis,
|
|
21
|
-
* enabling more precise control over how columns are joined.
|
|
7
|
+
* Join entry for spec-layer queries — the base join entry extended with
|
|
8
|
+
* per-axis domain constraints. Absent `qualifications` is equivalent to `[]`.
|
|
22
9
|
*
|
|
23
10
|
* @example
|
|
24
|
-
* // Join entry with axis qualifications
|
|
25
11
|
* {
|
|
26
12
|
* entry: querySpec,
|
|
27
|
-
* qualifications: [
|
|
28
|
-
* { axis: { name: 'sample' }, contextDomain: { ... } }
|
|
29
|
-
* ]
|
|
13
|
+
* qualifications: [{ axis: { name: 'sample' }, contextDomain: { ... } }]
|
|
30
14
|
* }
|
|
31
15
|
*/
|
|
32
16
|
type SpecQueryJoinEntry<C = PObjectId> = QueryJoinEntry<SpecQuery<C>> & {
|
|
33
|
-
|
|
34
|
-
/** Axis
|
|
17
|
+
qualifications?: {
|
|
18
|
+
/** Axis to qualify. */axis: SingleAxisSelector; /** Additional domain constraints for this axis. */
|
|
35
19
|
contextDomain: Domain;
|
|
36
20
|
}[];
|
|
37
21
|
};
|
|
38
22
|
/** @see QueryColumn */
|
|
39
23
|
type SpecQueryColumn<C = PObjectId> = QueryColumn<C>;
|
|
40
24
|
/** @see QueryInlineColumn */
|
|
41
|
-
type SpecQueryInlineColumn = QueryInlineColumn<
|
|
25
|
+
type SpecQueryInlineColumn = QueryInlineColumn<PColumnIdAndSpec>;
|
|
42
26
|
/** @see QuerySparseToDenseColumn */
|
|
43
27
|
type SpecQuerySparseToDenseColumn<C = PObjectId> = QuerySparseToDenseColumn<C, PColumnIdAndSpec>;
|
|
44
28
|
/** @see QuerySymmetricJoin */
|
|
@@ -57,7 +41,7 @@ type SpecQueryLinkerJoinLinker<C = PObjectId> = {
|
|
|
57
41
|
/** @see QueryLinkerJoin */
|
|
58
42
|
type SpecQueryLinkerJoin<C = PObjectId> = QueryLinkerJoin<SpecQueryLinkerJoinLinker<C>, SpecQueryJoinEntry<C>>;
|
|
59
43
|
/** @see QuerySliceAxes */
|
|
60
|
-
type SpecQuerySliceAxes<C = PObjectId> = QuerySliceAxes<SpecQuery<C>,
|
|
44
|
+
type SpecQuerySliceAxes<C = PObjectId> = QuerySliceAxes<SpecQuery<C>, SingleAxisSelector>;
|
|
61
45
|
/** @see QuerySort */
|
|
62
46
|
type SpecQuerySort<C = PObjectId> = QuerySort<SpecQuery<C>, SpecQueryExpression>;
|
|
63
47
|
/** @see QueryFilter */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query_spec.d.ts","names":[],"sources":["../../../../src/drivers/pframe/query/query_spec.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"query_spec.d.ts","names":[],"sources":["../../../../src/drivers/pframe/query/query_spec.ts"],"mappings":";;;;;;;;;;AAyCA;;;;;KAAY,kBAAA,KAAuB,SAAA,IAAa,cAAA,CAAe,SAAA,CAAU,CAAA;EACvE,cAAA;IAEQ,uBAAN,IAAA,EAAM,kBAAA,EAEe;IAArB,aAAA,EAAe,MAAA;EAAA;AAAA;;KAKP,eAAA,KAAoB,SAAA,IAAa,WAAA,CAAY,CAAA;;KAE7C,qBAAA,GAAwB,iBAAA,CAAkB,gBAAA;;KAE1C,4BAAA,KAAiC,SAAA,IAAa,wBAAA,CACxD,CAAA,EACA,gBAAA;;KAGU,sBAAA,KAA2B,SAAA,IAAa,kBAAA,CAAmB,kBAAA,CAAmB,CAAA;;KAE9E,kBAAA,KAAuB,SAA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A,GAA6B,2BAAA,CAA4B,mBAAA"}
|
|
@@ -142,21 +142,24 @@ function sortSpecQuery(query) {
|
|
|
142
142
|
default: return node;
|
|
143
143
|
}
|
|
144
144
|
},
|
|
145
|
-
joinEntry: (entry) =>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
145
|
+
joinEntry: (entry) => {
|
|
146
|
+
if (entry.qualifications === void 0 || entry.qualifications.length === 0) return entry;
|
|
147
|
+
return {
|
|
148
|
+
...entry,
|
|
149
|
+
qualifications: entry.qualifications.toSorted((a, b) => {
|
|
150
|
+
const ak = require_json.canonicalizeJson(a.axis);
|
|
151
|
+
const bk = require_json.canonicalizeJson(b.axis);
|
|
152
|
+
return ak < bk ? -1 : ak === bk ? 0 : 1;
|
|
153
|
+
})
|
|
154
|
+
};
|
|
155
|
+
}
|
|
153
156
|
});
|
|
154
157
|
}
|
|
155
158
|
function cmpQuerySpec(lhs, rhs) {
|
|
156
159
|
if (lhs.type !== rhs.type) return lhs.type < rhs.type ? -1 : 1;
|
|
157
160
|
switch (lhs.type) {
|
|
158
161
|
case "column": return lhs.column < rhs.column ? -1 : lhs.column === rhs.column ? 0 : 1;
|
|
159
|
-
case "inlineColumn": return lhs.spec.
|
|
162
|
+
case "inlineColumn": return lhs.spec.columnId < rhs.spec.columnId ? -1 : lhs.spec.columnId === rhs.spec.columnId ? 0 : 1;
|
|
160
163
|
case "sparseToDenseColumn": return lhs.column < rhs.column ? -1 : lhs.column === rhs.column ? 0 : 1;
|
|
161
164
|
case "innerJoin":
|
|
162
165
|
case "fullJoin": {
|
|
@@ -198,11 +201,13 @@ function cmpQuerySpec(lhs, rhs) {
|
|
|
198
201
|
function cmpQueryJoinEntrySpec(lhs, rhs) {
|
|
199
202
|
const cmp = cmpQuerySpec(lhs.entry, rhs.entry);
|
|
200
203
|
if (cmp !== 0) return cmp;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
const lhsQ = lhs.qualifications ?? [];
|
|
205
|
+
const rhsQ = rhs.qualifications ?? [];
|
|
206
|
+
if (lhsQ.length !== rhsQ.length) return lhsQ.length - rhsQ.length;
|
|
207
|
+
for (let i = 0; i < lhsQ.length; i++) {
|
|
208
|
+
const l = require_json.canonicalizeJson(lhsQ[i]);
|
|
209
|
+
const r = require_json.canonicalizeJson(rhsQ[i]);
|
|
210
|
+
if (l !== r) return l < r ? -1 : 1;
|
|
206
211
|
}
|
|
207
212
|
return 0;
|
|
208
213
|
}
|