aboutsummaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/interface/ut/protobuf_table_schema_ut.proto
blob: da1e48f691bc8412e463bda0223df4e0014d19b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
import "yt/yt_proto/yt/formats/extension.proto";

package NYT.NUnitTesting;

message TIntegral
{
    optional double DoubleField = 1;
    optional float FloatField = 2;
    optional int32 Int32Field = 3;
    optional int64 Int64Field = 4;
    optional uint32 Uint32Field = 5;
    optional uint64 Uint64Field = 6;
    optional sint32 Sint32Field = 7;
    optional sint64 Sint64Field = 8;
    optional fixed32 Fixed32Field = 9;
    optional fixed64 Fixed64Field = 10;
    optional sfixed32 Sfixed32Field = 11;
    optional sfixed64 Sfixed64Field = 12;
    optional bool BoolField = 13;
    enum TriBool
    {
        TRI_FALSE = 0;
        TRI_TRUE = 1;
        TRI_UNDEF = -1;
    }
    optional TriBool EnumField = 14;
}

message TRepeated
{
    repeated int32 Int32Field = 1;
}

message TRepeatedYtMode
{
    option (NYT.default_field_flags) = SERIALIZATION_YT;
    repeated int32 Int32Field = 1;
}

message TWithTypeOptions
{
    enum Color
    {
        WHITE = 0;
        BLUE = 1;
        RED = -1;
    }

    message TEmbedded
    {
        option (NYT.default_field_flags) = SERIALIZATION_YT;

        optional Color ColorIntField = 1 [(NYT.flags) = ENUM_INT];
        optional Color ColorStringField = 2 [(NYT.flags) = ENUM_STRING];
        optional bytes AnyField = 3 [(NYT.flags) = ANY];
    }

    optional Color ColorIntField = 1 [(NYT.flags) = ENUM_INT];
    optional Color ColorStringField = 2 [(NYT.flags) = ENUM_STRING];
    optional bytes AnyField = 3 [(NYT.flags) = ANY];
    optional bytes OtherColumnsField = 4 [(NYT.flags) = OTHER_COLUMNS];
    optional TEmbedded EmbeddedField = 5 [(NYT.flags) = SERIALIZATION_YT];
    repeated Color RepeatedEnumIntField = 6 [(NYT.flags) = SERIALIZATION_YT, (NYT.flags) = ENUM_INT];
}

message TWithTypeOptions_TypeMismatch_EnumInt
{
    optional int64 EnumField = 1 [(NYT.flags) = ENUM_INT];
}

message TWithTypeOptions_TypeMismatch_EnumString
{
    optional string EnumField = 1 [(NYT.flags) = ENUM_STRING];
}

message TWithTypeOptions_TypeMismatch_Any
{
    optional string AnyField = 1 [(NYT.flags) = ANY];
}

message TWithTypeOptions_TypeMismatch_OtherColumns
{
    optional string OtherColumnsField = 1 [(NYT.flags) = OTHER_COLUMNS];
}

message TOneOf
{
    oneof Chooser
    {
        double DoubleField = 1;
        int32 Int32Field = 2;
    }
    optional bool BoolField = 3;
}

message TWithRequired
{
    required string RequiredField = 1;
    optional string NotRequiredField = 2;
};

message TAggregated
{
    optional string StringField = 1;
    optional bytes BytesField = 2;
    optional TIntegral NestedField = 3;
    optional TRepeated NestedRepeatedField = 4;
    optional TOneOf NestedOneOfField = 5;
    optional TAggregated NestedRecursiveField = 6;
}

message TAliased
{
    optional int32 Key = 1         [(NYT.key_column_name) = "key"];
    optional double Subkey = 2     [(NYT.key_column_name) = "subkey"];
    optional TAggregated Data = 3;
}

////////////////////////////////////////////////////////////////////////////////

message TUrlRow
{
    optional string Host = 1     [(NYT.column_name) = "Host"];
    optional string Path = 2     [(NYT.column_name) = "Path"];
    optional sint32 HttpCode = 3 [(NYT.column_name) = "HttpCode"];
}

message TRowFieldSerializationOption
{
    optional TUrlRow UrlRow_1 = 1 [(NYT.flags) = SERIALIZATION_YT];
    optional TUrlRow UrlRow_2 = 2;
}

message TRowMessageSerializationOption
{
    option (NYT.default_field_flags) = SERIALIZATION_YT;
    optional TUrlRow UrlRow_1 = 1;
    optional TUrlRow UrlRow_2 = 2;
}

message TRowMixedSerializationOptions
{
    option (NYT.default_field_flags) = SERIALIZATION_YT;
    optional TUrlRow UrlRow_1 = 1;
    optional TUrlRow UrlRow_2 = 2 [(NYT.flags) = SERIALIZATION_PROTOBUF];
}

message TRowSerializedRepeatedFields
{
    option (NYT.default_field_flags) = SERIALIZATION_YT;
    repeated int64 Ints = 1;
    repeated TUrlRow UrlRows = 2;
}

message TUrlRowWithColumnNames
{
    optional string Host = 1     [(NYT.column_name) = "Host_ColumnName", (NYT.key_column_name) = "Host_KeyColumnName"];
    optional string Path = 2     [(NYT.key_column_name) = "Path_KeyColumnName"];
    optional sint32 HttpCode = 3;
}

message TRowMixedSerializationOptions_ColumnNames
{
    option (NYT.default_field_flags) = SERIALIZATION_YT;
    optional TUrlRowWithColumnNames UrlRow_1 = 1;
    optional TUrlRowWithColumnNames UrlRow_2 = 2 [(NYT.flags) = SERIALIZATION_PROTOBUF];
}

message TNoOptionInheritance
{
    message TDeepestEmbedded
    {
        optional int64 x = 1;
    }

    message TEmbedded
    {
        optional TDeepestEmbedded embedded = 1;
    }

    message TEmbeddedYt
    {
        option (NYT.default_field_flags) = SERIALIZATION_YT;

        optional TDeepestEmbedded embedded = 1;
    }

    message TEmbeddedProtobuf
    {
        option (NYT.default_field_flags) = SERIALIZATION_PROTOBUF;

        optional TDeepestEmbedded embedded = 1;
    }

    optional TEmbeddedYt EmbeddedYt_YtOption = 1 [(NYT.flags) = SERIALIZATION_YT];
    optional TEmbeddedYt EmbeddedYt_ProtobufOption = 2 [(NYT.flags) = SERIALIZATION_PROTOBUF];
    optional TEmbeddedYt EmbeddedYt_NoOption = 3;
    optional TEmbeddedProtobuf EmbeddedProtobuf_YtOption = 4 [(NYT.flags) = SERIALIZATION_YT];
    optional TEmbeddedProtobuf EmbeddedProtobuf_ProtobufOption = 5 [(NYT.flags) = SERIALIZATION_PROTOBUF];
    optional TEmbeddedProtobuf EmbeddedProtobuf_NoOption = 6;
    optional TEmbedded Embedded_YtOption = 7 [(NYT.flags) = SERIALIZATION_YT];
    optional TEmbedded Embedded_ProtobufOption = 8 [(NYT.flags) = SERIALIZATION_PROTOBUF];
    optional TEmbedded Embedded_NoOption = 9;
}

message TOptionalList
{
    repeated int64 OptionalListInt64 = 1 [(NYT.flags) = OPTIONAL_LIST, (NYT.flags) = SERIALIZATION_YT];
}

message TPacked
{
    repeated int64 PackedListInt64 = 1 [(NYT.flags) = SERIALIZATION_YT, packed=true];
}

message TCyclic
{
    option (NYT.default_field_flags) = SERIALIZATION_YT;

    message TA
    {
        option (NYT.default_field_flags) = SERIALIZATION_YT;
        repeated TB b = 1;
        optional TC c = 2;
    }

    message TB
    {
        option (NYT.default_field_flags) = SERIALIZATION_YT;
        optional TD d = 1;
    }

    message TC
    {
        option (NYT.default_field_flags) = SERIALIZATION_YT;
        optional TD d = 1;
    }

    message TD
    {
        option (NYT.default_field_flags) = SERIALIZATION_YT;
        optional TA a = 1;
    }

    message TE
    {
        optional TD d = 1 [(NYT.flags) = SERIALIZATION_PROTOBUF];
    }

    optional TA a = 1;
}

message TFieldSortOrder
{
    message TEmbeddedDefault {
        optional int64 x = 2;
        optional string y = 12;
        optional bool z = 1;
    }
    message TEmbeddedAsInProtoFile {
        option (NYT.message_flags) = DEPRECATED_SORT_FIELDS_AS_IN_PROTO_FILE;
        optional int64 x = 2;
        optional string y = 12;
        optional bool z = 1;
    }
    message TEmbeddedByFieldNumber {
        option (NYT.message_flags) = SORT_FIELDS_BY_FIELD_NUMBER;
        optional int64 x = 2;
        optional string y = 12;
        optional bool z = 1;
    }
    option (NYT.default_field_flags) = SERIALIZATION_YT;

    optional TEmbeddedDefault EmbeddedDefault = 1;
    optional TEmbeddedAsInProtoFile EmbeddedAsInProtoFile = 2;
    optional TEmbeddedByFieldNumber EmbeddedByFieldNumber = 3;
}

message TWithMap
{
    option (NYT.default_field_flags) = SERIALIZATION_YT;

    message TEmbedded {
        optional int64 x = 1;
        optional string y = 2;
    }

    map<int64, TEmbedded> MapDefault = 1;
    map<int64, TEmbedded> MapListOfStructsLegacy = 2 [(NYT.flags) = MAP_AS_LIST_OF_STRUCTS_LEGACY];
    map<int64, TEmbedded> MapListOfStructs = 3 [(NYT.flags) = MAP_AS_LIST_OF_STRUCTS];
    map<int64, TEmbedded> MapOptionalDict = 4 [(NYT.flags) = MAP_AS_OPTIONAL_DICT];
    map<int64, TEmbedded> MapDict = 5 [(NYT.flags) = MAP_AS_DICT];
}

message TWithOneof
{
    option (NYT.default_field_flags) = SERIALIZATION_YT;

    message TEmbedded
    {
        option (NYT.default_field_flags) = SERIALIZATION_YT;
        oneof Oneof {
            int64 x = 1;
            string y = 2;
        }
    }

    message TDefaultSeparateFields
    {
        option (NYT.default_oneof_flags) = SEPARATE_FIELDS;
        option (NYT.default_field_flags) = SERIALIZATION_YT;

        optional string field = 1;

        oneof Oneof2
        {
            option (NYT.variant_field_name) = "variant_field_name";
            option (NYT.oneof_flags) = VARIANT;
            string y2 = 4;
            TEmbedded z2 = 6;
            int64 x2 = 2;
        }

        oneof Oneof1
        {
            int64 x1 = 10;
            string y1 = 3;
            TEmbedded z1 = 5;
        }
    }

    message TNoDefault
    {
        option (NYT.default_field_flags) = SERIALIZATION_YT;

        optional string field = 1;

        oneof Oneof2
        {
            string y2 = 4;
            TEmbedded z2 = 6;
            int64 x2 = 2;
        }

        oneof Oneof1
        {
            option (NYT.oneof_flags) = SEPARATE_FIELDS;
            int64 x1 = 10;
            string y1 = 3;
            TEmbedded z1 = 5;
        }
    }

    message TSerializationProtobuf
    {
        oneof Oneof
        {
            int64 x1 = 2;
            string y1 = 1;
            TEmbedded z1 = 3;
        }
    }

    optional TDefaultSeparateFields DefaultSeparateFields = 1;
    optional TNoDefault NoDefault = 2;
    optional TSerializationProtobuf SerializationProtobuf = 3;

    oneof TopLevelOneof
    {
        int64 MemberOfTopLevelOneof = 4;
    }
}

message TEmbeddedStruct {
    optional float float1 = 1;
    optional string string1 = 2;
}

message TEmbedded2Message {
    option (NYT.default_field_flags) = SERIALIZATION_YT;
    optional uint64 embedded2_num = 10;
    optional TEmbeddedStruct embedded2_struct = 17;
    repeated string embedded2_repeated = 42;
}

message TEmbedded1Message {
    option (NYT.default_field_flags) = SERIALIZATION_YT;
    required TEmbedded2Message t2 = 1 [(NYT.flags) = EMBEDDED];
    oneof variant {
        string str_variant = 101;
        uint64 uint_variant = 102;
    }
    optional uint64 embedded_num = 10; // make intentional field_num collision!
    optional string embedded_extra_field = 11;
}

message TEmbeddingMessage {
    optional bytes other_columns_field = 15 [(NYT.flags) = OTHER_COLUMNS];
    required TEmbedded1Message t1 = 2 [(NYT.flags) = EMBEDDED];
    optional uint64 num = 12;
    optional string extra_field = 13;
}