@platforma-open/milaboratories.software-ptabler.schema 1.12.6 → 1.13.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/basic_steps.d.ts +41 -1
- package/dist/basic_steps.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/basic_steps.ts +48 -1
- package/src/index.ts +5 -2
package/dist/basic_steps.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Expression } from './expressions';
|
|
1
|
+
import type { Expression, SelectorExpression } from './expressions';
|
|
2
2
|
/**
|
|
3
3
|
* Defines a step that adds one or more new columns to an existing table in the tablespace.
|
|
4
4
|
* This operation modifies the specified table in place.
|
|
@@ -73,6 +73,46 @@ export interface SelectStep {
|
|
|
73
73
|
*/
|
|
74
74
|
columns: Expression[];
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Determines which of the duplicate rows are kept.
|
|
78
|
+
*/
|
|
79
|
+
export type UniqueKeepStrategy = 'any' | 'none' | 'first' | 'last';
|
|
80
|
+
export interface UniqueStep {
|
|
81
|
+
/**
|
|
82
|
+
* The type identifier for this step.
|
|
83
|
+
* Must be 'unique'.
|
|
84
|
+
*/
|
|
85
|
+
type: 'unique';
|
|
86
|
+
/**
|
|
87
|
+
* The name of the input table in the tablespace from which unique rows will be selected.
|
|
88
|
+
*/
|
|
89
|
+
inputTable: string;
|
|
90
|
+
/**
|
|
91
|
+
* The name for the resulting unique table that will be added to the tablespace.
|
|
92
|
+
*/
|
|
93
|
+
outputTable: string;
|
|
94
|
+
/**
|
|
95
|
+
* Column name(s) or selector expression to consider when identifying duplicate rows.
|
|
96
|
+
* Can be a single column name, an array of column names, or a selector expression.
|
|
97
|
+
* If not provided, all columns are used.
|
|
98
|
+
*/
|
|
99
|
+
subset?: string | string[] | SelectorExpression;
|
|
100
|
+
/**
|
|
101
|
+
* Which of the duplicate rows to keep:
|
|
102
|
+
* - 'any': Does not give any guarantee of which row is kept (allows optimizations).
|
|
103
|
+
* - 'none': Don't keep duplicate rows.
|
|
104
|
+
* - 'first': Keep first unique row.
|
|
105
|
+
* - 'last': Keep last unique row.
|
|
106
|
+
* Defaults to 'any'.
|
|
107
|
+
*/
|
|
108
|
+
keep?: UniqueKeepStrategy;
|
|
109
|
+
/**
|
|
110
|
+
* Keep the same order as the original data.
|
|
111
|
+
* This may be more expensive to compute.
|
|
112
|
+
* Defaults to false.
|
|
113
|
+
*/
|
|
114
|
+
maintainOrder?: boolean;
|
|
115
|
+
}
|
|
76
116
|
/**
|
|
77
117
|
* Defines a step that adds new columns to an input table (or replaces existing ones
|
|
78
118
|
* if names collide) and outputs the result to a new table in the tablespace.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic_steps.d.ts","sourceRoot":"","sources":["../src/basic_steps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"basic_steps.d.ts","sourceRoot":"","sources":["../src/basic_steps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,IAAI,EAAE,aAAa,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IAC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WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;CACX"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { ReadCsvStep, ReadNdjsonStep, WriteCsvStep, WriteNdjsonStep, BaseFileReadStep, BaseFileWriteStep, WriteParquetStep, ReadParquetStep } from './io';
|
|
2
|
-
import type { AddColumnsStep, FilterStep, LimitStep, SelectStep, WithColumnsStep, WithoutColumnsStep } from './basic_steps';
|
|
2
|
+
import type { AddColumnsStep, FilterStep, LimitStep, SelectStep, UniqueKeepStrategy, UniqueStep, WithColumnsStep, WithoutColumnsStep } from './basic_steps';
|
|
3
3
|
import type { AggregateStep } from './aggregate';
|
|
4
4
|
import type { AnyJoinStep } from './join';
|
|
5
5
|
import type { ConcatenateStep } from './concatenate';
|
|
6
6
|
import type { SortStep } from './sort';
|
|
7
7
|
import type { WriteFrameStep } from './write_frame';
|
|
8
8
|
import type { ReadFrameStep } from './read_frame';
|
|
9
|
-
export type PTablerStep = ReadCsvStep | ReadNdjsonStep | ReadParquetStep | WriteCsvStep | WriteNdjsonStep | WriteParquetStep | AddColumnsStep | FilterStep | LimitStep | AggregateStep | AnyJoinStep | ConcatenateStep | SortStep | SelectStep | WithColumnsStep | WithoutColumnsStep | WriteFrameStep | ReadFrameStep;
|
|
9
|
+
export type PTablerStep = ReadCsvStep | ReadNdjsonStep | ReadParquetStep | WriteCsvStep | WriteNdjsonStep | WriteParquetStep | AddColumnsStep | FilterStep | LimitStep | AggregateStep | AnyJoinStep | ConcatenateStep | SortStep | SelectStep | UniqueStep | WithColumnsStep | WithoutColumnsStep | WriteFrameStep | ReadFrameStep;
|
|
10
10
|
export type PTablerWorkflow = {
|
|
11
11
|
workflow: PTablerStep[];
|
|
12
12
|
};
|
|
13
|
-
export type { AddColumnsStep, AggregateStep, AnyJoinStep, BaseFileReadStep, BaseFileWriteStep, ConcatenateStep, FilterStep, ReadCsvStep, ReadNdjsonStep, SelectStep, SortStep, WithColumnsStep, WithoutColumnsStep, WriteCsvStep, WriteNdjsonStep, };
|
|
13
|
+
export type { AddColumnsStep, AggregateStep, AnyJoinStep, BaseFileReadStep, BaseFileWriteStep, ConcatenateStep, FilterStep, ReadCsvStep, ReadNdjsonStep, SelectStep, SortStep, UniqueKeepStrategy, UniqueStep, WithColumnsStep, WithoutColumnsStep, WriteCsvStep, WriteNdjsonStep, };
|
|
14
14
|
export type * from './expressions';
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,kBAAkB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,MAAM,WAAW,GACnB,WAAW,GACX,cAAc,GACd,eAAe,GACf,YAAY,GACZ,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,UAAU,GACV,SAAS,GACT,aAAa,GACb,WAAW,GACX,eAAe,GACf,QAAQ,GACR,UAAU,GACV,eAAe,GACf,kBAA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IAC5B,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB,CAAC;AAGF,YAAY,EACV,cAAc,EAAE,aAAa,EAC7B,WAAW,EAAE,gBAAgB,EAC7B,iBAAiB,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAC3D,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,kBAAkB,EAAE,UAAU,EACpE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EACjD,eAAe,GAChB,CAAC;AAGF,mBAAmB,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-open/milaboratories.software-ptabler.schema",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Type definitions for PTabler",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"eslint": "^9.25.1",
|
|
24
24
|
"typescript": "~5.6.3",
|
|
25
|
-
"@milaboratories/ts-builder": "1.0
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
25
|
+
"@milaboratories/ts-builder": "1.2.0",
|
|
26
|
+
"@milaboratories/ts-configs": "1.2.0",
|
|
27
|
+
"@platforma-sdk/eslint-config": "1.2.0"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "ts-builder build --target node",
|
package/src/basic_steps.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Expression } from './expressions';
|
|
1
|
+
import type { Expression, SelectorExpression } from './expressions';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Defines a step that adds one or more new columns to an existing table in the tablespace.
|
|
@@ -85,6 +85,53 @@ export interface SelectStep {
|
|
|
85
85
|
columns: Expression[];
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Determines which of the duplicate rows are kept.
|
|
90
|
+
*/
|
|
91
|
+
export type UniqueKeepStrategy = 'any' | 'none' | 'first' | 'last';
|
|
92
|
+
|
|
93
|
+
export interface UniqueStep {
|
|
94
|
+
/**
|
|
95
|
+
* The type identifier for this step.
|
|
96
|
+
* Must be 'unique'.
|
|
97
|
+
*/
|
|
98
|
+
type: 'unique';
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The name of the input table in the tablespace from which unique rows will be selected.
|
|
102
|
+
*/
|
|
103
|
+
inputTable: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The name for the resulting unique table that will be added to the tablespace.
|
|
107
|
+
*/
|
|
108
|
+
outputTable: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Column name(s) or selector expression to consider when identifying duplicate rows.
|
|
112
|
+
* Can be a single column name, an array of column names, or a selector expression.
|
|
113
|
+
* If not provided, all columns are used.
|
|
114
|
+
*/
|
|
115
|
+
subset?: string | string[] | SelectorExpression;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Which of the duplicate rows to keep:
|
|
119
|
+
* - 'any': Does not give any guarantee of which row is kept (allows optimizations).
|
|
120
|
+
* - 'none': Don't keep duplicate rows.
|
|
121
|
+
* - 'first': Keep first unique row.
|
|
122
|
+
* - 'last': Keep last unique row.
|
|
123
|
+
* Defaults to 'any'.
|
|
124
|
+
*/
|
|
125
|
+
keep?: UniqueKeepStrategy;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Keep the same order as the original data.
|
|
129
|
+
* This may be more expensive to compute.
|
|
130
|
+
* Defaults to false.
|
|
131
|
+
*/
|
|
132
|
+
maintainOrder?: boolean;
|
|
133
|
+
}
|
|
134
|
+
|
|
88
135
|
/**
|
|
89
136
|
* Defines a step that adds new columns to an input table (or replaces existing ones
|
|
90
137
|
* if names collide) and outputs the result to a new table in the tablespace.
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,8 @@ import type {
|
|
|
13
13
|
FilterStep,
|
|
14
14
|
LimitStep,
|
|
15
15
|
SelectStep,
|
|
16
|
+
UniqueKeepStrategy,
|
|
17
|
+
UniqueStep,
|
|
16
18
|
WithColumnsStep,
|
|
17
19
|
WithoutColumnsStep,
|
|
18
20
|
} from './basic_steps';
|
|
@@ -38,6 +40,7 @@ export type PTablerStep =
|
|
|
38
40
|
| ConcatenateStep
|
|
39
41
|
| SortStep
|
|
40
42
|
| SelectStep
|
|
43
|
+
| UniqueStep
|
|
41
44
|
| WithColumnsStep
|
|
42
45
|
| WithoutColumnsStep
|
|
43
46
|
| WriteFrameStep
|
|
@@ -52,8 +55,8 @@ export type {
|
|
|
52
55
|
AddColumnsStep, AggregateStep,
|
|
53
56
|
AnyJoinStep, BaseFileReadStep,
|
|
54
57
|
BaseFileWriteStep, ConcatenateStep, FilterStep, ReadCsvStep,
|
|
55
|
-
ReadNdjsonStep, SelectStep, SortStep,
|
|
56
|
-
WithoutColumnsStep, WriteCsvStep,
|
|
58
|
+
ReadNdjsonStep, SelectStep, SortStep, UniqueKeepStrategy, UniqueStep,
|
|
59
|
+
WithColumnsStep, WithoutColumnsStep, WriteCsvStep,
|
|
57
60
|
WriteNdjsonStep,
|
|
58
61
|
};
|
|
59
62
|
|