|
1 | 1 | syntax = "proto3"; |
2 | 2 |
|
3 | | -package dataform; |
| 3 | +package dataform.dataprep; |
4 | 4 |
|
5 | | -option java_package = "com.dataform.protos"; |
| 5 | +option java_package = "com.dataform.dataprep.protos"; |
6 | 6 | option java_multiple_files = true; |
7 | 7 |
|
8 | | -option go_package = "github.com/dataform-co/dataform/protos/dataform"; |
| 8 | +option go_package = "github.com/dataform-co/dataform/protos/dataform/dataprep"; |
9 | 9 |
|
10 | | -message DataPreparationDefinition { |
| 10 | +message DataPreparation { |
11 | 11 | repeated DataPreparationNode nodes = 1; |
12 | 12 | DataPreparationGenerated generated = 2; |
| 13 | + DataPreparationConfiguration configuration = 3; |
13 | 14 | } |
14 | 15 |
|
15 | 16 | message DataPreparationNode { |
16 | 17 | string id = 1; |
17 | | - DataPreparationNodeSource source = 2; |
18 | | - repeated DataPreparationNodeStep steps = 3; |
19 | | - DataPreparationNodeGenerated generated = 4; |
20 | | - // Destination BigQuery table(s) are defined within the data preparation |
21 | | - optional DataPreparationNodeDestination destination = 5; |
| 18 | + Source source = 2; |
| 19 | + repeated Step steps = 3; |
| 20 | + NodeGenerated generated = 4; |
| 21 | + Destination destination = 5; |
22 | 22 | } |
23 | 23 |
|
24 | | -message DataPreparationNodeSource { |
| 24 | +message DataPreparationConfiguration { |
| 25 | + TableReference error_table = 1; |
| 26 | +} |
| 27 | + |
| 28 | +message Source { |
25 | 29 | oneof source { |
26 | 30 | string node_id = 1; |
27 | 31 | TableReference table = 2; |
28 | 32 | Join join = 3; |
29 | 33 | } |
30 | 34 | } |
31 | 35 |
|
32 | | -message DataPreparationNodeDestination { |
| 36 | +message Destination { |
33 | 37 | oneof destination { |
34 | 38 | TableReference table = 1; |
35 | 39 | } |
36 | 40 | } |
37 | 41 |
|
38 | | -message DataPreparationNodeStep { |
| 42 | +message Step { |
39 | 43 | string id = 1; |
40 | 44 | string description = 2; |
| 45 | + |
41 | 46 | oneof definition { |
42 | 47 | ColumnStep column_step = 3; |
43 | 48 | FilterStep filter_step = 4; |
44 | 49 | } |
45 | | - DataPreparationNodeStepGenerated generated = 5; |
| 50 | + StepGenerated generated = 5; |
46 | 51 | } |
47 | 52 |
|
48 | 53 | message ColumnStep { |
49 | 54 | string column_name = 1; |
50 | 55 | Expression expression = 2; |
51 | 56 | } |
52 | 57 |
|
| 58 | +enum FilterType { |
| 59 | + FILTER_TYPE_UNSPECIFIED = 0; |
| 60 | + ROW_FILTER_KEEP_ROWS = 1; |
| 61 | + VALIDATION = 2; |
| 62 | +} |
| 63 | + |
53 | 64 | message FilterStep { |
54 | 65 | Expression expression = 1; |
| 66 | + optional FilterType filter_type = 2; |
55 | 67 | } |
56 | 68 |
|
57 | 69 | message Expression { |
@@ -98,75 +110,76 @@ message TableReference { |
98 | 110 | } |
99 | 111 |
|
100 | 112 | message DataPreparationGenerated { |
101 | | - repeated DataPreparationValidationError validation_errors = 1; |
| 113 | + repeated ValidationError validation_errors = 1; |
102 | 114 | optional string location = 2; |
103 | 115 | } |
104 | 116 |
|
105 | | -message DataPreparationNodeGenerated { |
106 | | - repeated DataPreparationSection sections = 1; |
| 117 | +message NodeGenerated { |
| 118 | + repeated Section sections = 1; |
107 | 119 | repeated string sources = 2; |
108 | | - repeated DataPreparationValidationError validation_errors = 3; |
109 | | - optional DataPreparationSchema output_schema = 4; |
110 | | - DataPreparationNodeSourceGenerated source_generated = 5; |
111 | | - optional DataPreparationNodeDestinationGenerated destination_generated = 6; |
| 120 | + repeated ValidationError validation_errors = 3; |
| 121 | + Schema output_schema = 4; |
| 122 | + SourceGenerated source_generated = 5; |
| 123 | + DestinationGenerated destination_generated = 6; |
112 | 124 | } |
113 | 125 |
|
114 | | -message DataPreparationSection { |
115 | | - DataPreparationSectionType type = 1; |
| 126 | +message Section { |
| 127 | + SectionType type = 1; |
116 | 128 | string label = 2; |
117 | 129 | } |
118 | 130 |
|
119 | | -enum DataPreparationSectionType { |
| 131 | +enum SectionType { |
120 | 132 | SECTION_TYPE_UNSPECIFIED = 0; |
121 | 133 | SECTION_UNPARSEABLE = 1; |
122 | 134 | SECTION_SOURCE_TABLE = 2; |
123 | 135 | SECTION_SQL = 3; |
124 | 136 | SECTION_DESTINATION_TABLE = 4; |
| 137 | + SECTION_JOIN = 5; |
125 | 138 | } |
126 | 139 |
|
127 | | -message DataPreparationNodeSourceGenerated { |
128 | | - optional DataPreparationNodeSourceSourceSchema source_schema = 4; |
| 140 | +message SourceGenerated { |
| 141 | + SourceSchema source_schema = 4; |
129 | 142 | } |
130 | 143 |
|
131 | | -message DataPreparationNodeSourceSourceSchema { |
| 144 | +message SourceSchema { |
132 | 145 | oneof source_schema { |
133 | | - DataPreparationSchema node_schema = 1; |
134 | | - DataPreparationSchema table_schema = 2; |
| 146 | + Schema node_schema = 1; |
| 147 | + Schema table_schema = 2; |
135 | 148 | JoinSchema join_schema = 3; |
136 | 149 | } |
137 | 150 | } |
138 | 151 |
|
139 | 152 | message JoinSchema { |
140 | | - DataPreparationSchema left_schema = 1; |
141 | | - DataPreparationSchema right_schema = 2; |
| 153 | + Schema left_schema = 1; |
| 154 | + Schema right_schema = 2; |
142 | 155 | } |
143 | 156 |
|
144 | | -message DataPreparationNodeDestinationGenerated { |
145 | | - optional DataPreparationSchema schema = 1; |
| 157 | +message DestinationGenerated { |
| 158 | + Schema schema = 1; |
146 | 159 | } |
147 | 160 |
|
148 | | -message DataPreparationNodeStepGenerated { |
| 161 | +message StepGenerated { |
149 | 162 | repeated string source_columns = 1; |
150 | | - repeated DataPreparationValidationError validation_errors = 2; |
| 163 | + repeated ValidationError validation_errors = 2; |
151 | 164 | } |
152 | 165 |
|
153 | | -message DataPreparationSchema { |
154 | | - repeated DataPreparationSchemaField field = 1; |
| 166 | +message Schema { |
| 167 | + repeated Field field = 1; |
155 | 168 | } |
156 | 169 |
|
157 | | -message DataPreparationSchemaField { |
| 170 | +message Field { |
158 | 171 | string name = 1; |
159 | 172 | optional string type = 2; |
160 | 173 | optional string mode = 3; |
161 | | - repeated DataPreparationSchemaField fields = 4; |
| 174 | + repeated Field fields = 4; |
162 | 175 | } |
163 | 176 |
|
164 | | -message DataPreparationValidationError { |
165 | | - DataPreparationValidationErrorLevel level = 1; |
| 177 | +message ValidationError { |
| 178 | + ValidationErrorLevel level = 1; |
166 | 179 | string description = 2; |
167 | 180 | } |
168 | 181 |
|
169 | | -enum DataPreparationValidationErrorLevel { |
| 182 | +enum ValidationErrorLevel { |
170 | 183 | LEVEL_UNSPECIFIED = 0; |
171 | 184 | LEVEL_WARN = 1; |
172 | 185 | LEVEL_ERROR = 2; |
|
0 commit comments