@platforma-open/milaboratories.software-ptabler.schema 1.11.2 → 1.11.3
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.d.ts +3 -2
- package/dist/io.d.ts +12 -0
- package/dist/write_frame.d.ts +57 -0
- package/package.json +3 -3
- package/src/index.ts +22 -3
- package/src/io.ts +14 -0
- package/src/write_frame.ts +66 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ReadCsvStep, ReadNdjsonStep, WriteCsvStep, WriteNdjsonStep, BaseFileReadStep, BaseFileWriteStep } from './io';
|
|
1
|
+
import { ReadCsvStep, ReadNdjsonStep, WriteCsvStep, WriteNdjsonStep, BaseFileReadStep, BaseFileWriteStep, WriteParquetStep, ReadParquetStep } from './io';
|
|
2
2
|
import { AddColumnsStep, FilterStep, SelectStep, WithColumnsStep, WithoutColumnsStep } from './basic_steps';
|
|
3
3
|
import { AggregateStep } from './aggregate';
|
|
4
4
|
import { AnyJoinStep } from './join';
|
|
5
5
|
import { ConcatenateStep } from './concatenate';
|
|
6
6
|
import { SortStep } from './sort';
|
|
7
|
-
|
|
7
|
+
import { WriteFrameStep } from './write_frame';
|
|
8
|
+
export type PTablerStep = ReadCsvStep | ReadNdjsonStep | ReadParquetStep | WriteCsvStep | WriteNdjsonStep | WriteParquetStep | AddColumnsStep | FilterStep | AggregateStep | AnyJoinStep | ConcatenateStep | SortStep | SelectStep | WithColumnsStep | WithoutColumnsStep | WriteFrameStep;
|
|
8
9
|
export type PTablerWorkflow = {
|
|
9
10
|
workflow: PTablerStep[];
|
|
10
11
|
};
|
package/dist/io.d.ts
CHANGED
|
@@ -59,6 +59,11 @@ export interface ReadNdjsonStep extends BaseFileReadStep {
|
|
|
59
59
|
/** The type of the step, which is always 'read_ndjson' for this operation. */
|
|
60
60
|
type: 'read_ndjson';
|
|
61
61
|
}
|
|
62
|
+
/** Represents the configuration for a step that reads data from an Apache Parquet file into the tablespace. */
|
|
63
|
+
export interface ReadParquetStep extends BaseFileReadStep {
|
|
64
|
+
/** The type of the step, which is always 'read_parquet' for this operation. */
|
|
65
|
+
type: 'read_parquet';
|
|
66
|
+
}
|
|
62
67
|
/**
|
|
63
68
|
* Base interface for file writing operations that contains common fields
|
|
64
69
|
* shared across different file format writers.
|
|
@@ -87,3 +92,10 @@ export interface WriteNdjsonStep extends BaseFileWriteStep {
|
|
|
87
92
|
/** The type of the step, which is always 'write_ndjson' for this operation. */
|
|
88
93
|
type: 'write_ndjson';
|
|
89
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Represents the configuration for a step that writes a table from the tablespace to an Apache Parquet file.
|
|
97
|
+
*/
|
|
98
|
+
export interface WriteParquetStep extends BaseFileWriteStep {
|
|
99
|
+
/** The type of the step, which is always 'write_parquet' for this operation. */
|
|
100
|
+
type: 'write_parquet';
|
|
101
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Axes values are used as unique key to access the column data,
|
|
3
|
+
* so they cannot be floating point numbers.
|
|
4
|
+
*/
|
|
5
|
+
export type AxisType = 'Int' | 'Long' | 'String';
|
|
6
|
+
/** PColumn values could be of any type supported by PFrames. */
|
|
7
|
+
export type ColumnType = 'Int' | 'Long' | 'Float' | 'Double' | 'String';
|
|
8
|
+
export interface AxisMapping {
|
|
9
|
+
/** The name of the column in the input table. */
|
|
10
|
+
column: string;
|
|
11
|
+
/**
|
|
12
|
+
* The type of the axis to be created.
|
|
13
|
+
* A cast would be performed if the type of the column in the input table is different.
|
|
14
|
+
* Warning: cast failure will result in an error.
|
|
15
|
+
*/
|
|
16
|
+
type: AxisType;
|
|
17
|
+
}
|
|
18
|
+
export interface ColumnMapping {
|
|
19
|
+
/** The name of the column in the input table. */
|
|
20
|
+
column: string;
|
|
21
|
+
/**
|
|
22
|
+
* The value type of the PColumn to be created.
|
|
23
|
+
* A cast would be performed if the type of the column in the input table is different.
|
|
24
|
+
* Warning: cast failure will produce null values in the PColumn.
|
|
25
|
+
*/
|
|
26
|
+
type: ColumnType;
|
|
27
|
+
}
|
|
28
|
+
/** Defines a step that creates a PFrame from the lazy table. */
|
|
29
|
+
export interface WriteFrameStep {
|
|
30
|
+
/** The type identifier for this step. */
|
|
31
|
+
type: 'write_frame';
|
|
32
|
+
/** The name of the table from the tablespace which will be written. */
|
|
33
|
+
inputTable: string;
|
|
34
|
+
/**
|
|
35
|
+
* The name of the frame to be created.
|
|
36
|
+
* A folder with this name will be created in the working directory.
|
|
37
|
+
* The folder will contain the .datainfo and .parquet files representing the frame's PColumns.
|
|
38
|
+
*/
|
|
39
|
+
frameName: string;
|
|
40
|
+
/**
|
|
41
|
+
* Axes specs, the order of axes in PColumns will match the order of axes in this array.
|
|
42
|
+
* Each column in the input table could be used as axis or PColumn only once.
|
|
43
|
+
* Warning: rows with null values in axes columns of input table will be discarded.
|
|
44
|
+
*/
|
|
45
|
+
axes: AxisMapping[];
|
|
46
|
+
/**
|
|
47
|
+
* PColumns specs.
|
|
48
|
+
* Each column in the input table could be used as axis or PColumn only once.
|
|
49
|
+
*/
|
|
50
|
+
columns: ColumnMapping[];
|
|
51
|
+
/**
|
|
52
|
+
* Partition key length, specifies the number of axes to be split into metadata partition key.
|
|
53
|
+
* Default: 0, which means no partitioning.
|
|
54
|
+
* Must be strictly less than the number of axes.
|
|
55
|
+
*/
|
|
56
|
+
partitionKeyLength: number;
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-open/milaboratories.software-ptabler.schema",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.3",
|
|
4
4
|
"description": "Type definitions for PTabler",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@platforma-sdk/eslint-config": "",
|
|
22
21
|
"vite-plugin-dts": "^4.5.3",
|
|
23
22
|
"eslint": "^9.25.1",
|
|
24
23
|
"typescript": "~5.6.3",
|
|
25
|
-
"vite": "^6.3.5"
|
|
24
|
+
"vite": "^6.3.5",
|
|
25
|
+
"@platforma-sdk/eslint-config": "1.1.0"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"type-check": "tsc --noEmit --composite false",
|
package/src/index.ts
CHANGED
|
@@ -1,15 +1,33 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
ReadCsvStep,
|
|
3
|
+
ReadNdjsonStep,
|
|
4
|
+
WriteCsvStep,
|
|
5
|
+
WriteNdjsonStep,
|
|
6
|
+
BaseFileReadStep,
|
|
7
|
+
BaseFileWriteStep,
|
|
8
|
+
WriteParquetStep,
|
|
9
|
+
ReadParquetStep,
|
|
10
|
+
} from './io';
|
|
11
|
+
import type {
|
|
12
|
+
AddColumnsStep,
|
|
13
|
+
FilterStep,
|
|
14
|
+
SelectStep,
|
|
15
|
+
WithColumnsStep,
|
|
16
|
+
WithoutColumnsStep,
|
|
17
|
+
} from './basic_steps';
|
|
3
18
|
import type { AggregateStep } from './aggregate';
|
|
4
19
|
import type { AnyJoinStep } from './join';
|
|
5
20
|
import type { ConcatenateStep } from './concatenate';
|
|
6
21
|
import type { SortStep } from './sort';
|
|
22
|
+
import type { WriteFrameStep } from './write_frame';
|
|
7
23
|
|
|
8
24
|
export type PTablerStep =
|
|
9
25
|
| ReadCsvStep
|
|
10
26
|
| ReadNdjsonStep
|
|
27
|
+
| ReadParquetStep
|
|
11
28
|
| WriteCsvStep
|
|
12
29
|
| WriteNdjsonStep
|
|
30
|
+
| WriteParquetStep
|
|
13
31
|
| AddColumnsStep
|
|
14
32
|
| FilterStep
|
|
15
33
|
| AggregateStep
|
|
@@ -18,7 +36,8 @@ export type PTablerStep =
|
|
|
18
36
|
| SortStep
|
|
19
37
|
| SelectStep
|
|
20
38
|
| WithColumnsStep
|
|
21
|
-
| WithoutColumnsStep
|
|
39
|
+
| WithoutColumnsStep
|
|
40
|
+
| WriteFrameStep;
|
|
22
41
|
|
|
23
42
|
export type PTablerWorkflow = {
|
|
24
43
|
workflow: PTablerStep[];
|
package/src/io.ts
CHANGED
|
@@ -64,6 +64,12 @@ export interface ReadNdjsonStep extends BaseFileReadStep {
|
|
|
64
64
|
type: 'read_ndjson';
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/** Represents the configuration for a step that reads data from an Apache Parquet file into the tablespace. */
|
|
68
|
+
export interface ReadParquetStep extends BaseFileReadStep {
|
|
69
|
+
/** The type of the step, which is always 'read_parquet' for this operation. */
|
|
70
|
+
type: 'read_parquet';
|
|
71
|
+
}
|
|
72
|
+
|
|
67
73
|
/**
|
|
68
74
|
* Base interface for file writing operations that contains common fields
|
|
69
75
|
* shared across different file format writers.
|
|
@@ -104,3 +110,11 @@ export interface WriteNdjsonStep extends BaseFileWriteStep {
|
|
|
104
110
|
/** The type of the step, which is always 'write_ndjson' for this operation. */
|
|
105
111
|
type: 'write_ndjson';
|
|
106
112
|
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Represents the configuration for a step that writes a table from the tablespace to an Apache Parquet file.
|
|
116
|
+
*/
|
|
117
|
+
export interface WriteParquetStep extends BaseFileWriteStep {
|
|
118
|
+
/** The type of the step, which is always 'write_parquet' for this operation. */
|
|
119
|
+
type: 'write_parquet';
|
|
120
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Axes values are used as unique key to access the column data,
|
|
3
|
+
* so they cannot be floating point numbers.
|
|
4
|
+
*/
|
|
5
|
+
export type AxisType = 'Int' | 'Long' | 'String';
|
|
6
|
+
|
|
7
|
+
/** PColumn values could be of any type supported by PFrames. */
|
|
8
|
+
export type ColumnType = 'Int' | 'Long' | 'Float' | 'Double' | 'String';
|
|
9
|
+
|
|
10
|
+
export interface AxisMapping {
|
|
11
|
+
/** The name of the column in the input table. */
|
|
12
|
+
column: string;
|
|
13
|
+
/**
|
|
14
|
+
* The type of the axis to be created.
|
|
15
|
+
* A cast would be performed if the type of the column in the input table is different.
|
|
16
|
+
* Warning: cast failure will result in an error.
|
|
17
|
+
*/
|
|
18
|
+
type: AxisType;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ColumnMapping {
|
|
22
|
+
/** The name of the column in the input table. */
|
|
23
|
+
column: string;
|
|
24
|
+
/**
|
|
25
|
+
* The value type of the PColumn to be created.
|
|
26
|
+
* A cast would be performed if the type of the column in the input table is different.
|
|
27
|
+
* Warning: cast failure will produce null values in the PColumn.
|
|
28
|
+
*/
|
|
29
|
+
type: ColumnType;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Defines a step that creates a PFrame from the lazy table. */
|
|
33
|
+
export interface WriteFrameStep {
|
|
34
|
+
/** The type identifier for this step. */
|
|
35
|
+
type: 'write_frame';
|
|
36
|
+
|
|
37
|
+
/** The name of the table from the tablespace which will be written. */
|
|
38
|
+
inputTable: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The name of the frame to be created.
|
|
42
|
+
* A folder with this name will be created in the working directory.
|
|
43
|
+
* The folder will contain the .datainfo and .parquet files representing the frame's PColumns.
|
|
44
|
+
*/
|
|
45
|
+
frameName: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Axes specs, the order of axes in PColumns will match the order of axes in this array.
|
|
49
|
+
* Each column in the input table could be used as axis or PColumn only once.
|
|
50
|
+
* Warning: rows with null values in axes columns of input table will be discarded.
|
|
51
|
+
*/
|
|
52
|
+
axes: AxisMapping[];
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* PColumns specs.
|
|
56
|
+
* Each column in the input table could be used as axis or PColumn only once.
|
|
57
|
+
*/
|
|
58
|
+
columns: ColumnMapping[];
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Partition key length, specifies the number of axes to be split into metadata partition key.
|
|
62
|
+
* Default: 0, which means no partitioning.
|
|
63
|
+
* Must be strictly less than the number of axes.
|
|
64
|
+
*/
|
|
65
|
+
partitionKeyLength: number;
|
|
66
|
+
}
|