risingwave_pb/
data.rs

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
403
404
405
406
407
408
409
410
411
412
413
414
415
// This file is @generated by prost-build.
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Interval {
    #[prost(int32, tag = "1")]
    pub months: i32,
    #[prost(int32, tag = "2")]
    pub days: i32,
    #[prost(int64, tag = "3")]
    pub usecs: i64,
}
#[derive(prost_helpers::AnyPB)]
#[derive(Eq, Hash)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[prost(skip_debug)]
pub struct DataType {
    #[prost(enumeration = "data_type::TypeName", tag = "1")]
    pub type_name: i32,
    /// Data length for char.
    /// Max data length for varchar.
    /// Precision for time, decimal.
    #[prost(uint32, tag = "2")]
    pub precision: u32,
    /// Scale for decimal.
    #[prost(uint32, tag = "3")]
    pub scale: u32,
    #[prost(bool, tag = "4")]
    pub is_nullable: bool,
    #[prost(enumeration = "data_type::IntervalType", tag = "5")]
    pub interval_type: i32,
    /// For struct type, it represents all the fields in the struct.
    /// For list type it only contains 1 element which is the inner item type of the List.
    /// For example, `ARRAY<INTEGER>` will be represented as `vec!\[DataType::Int32\]`.
    #[prost(message, repeated, tag = "6")]
    pub field_type: ::prost::alloc::vec::Vec<DataType>,
    /// Name of the fields if it is a struct type. For other types it will be empty.
    #[prost(string, repeated, tag = "7")]
    pub field_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Nested message and enum types in `DataType`.
pub mod data_type {
    #[derive(prost_helpers::AnyPB)]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum IntervalType {
        Unspecified = 0,
        Year = 1,
        Month = 2,
        Day = 3,
        Hour = 4,
        Minute = 5,
        Second = 6,
        YearToMonth = 7,
        DayToHour = 8,
        DayToMinute = 9,
        DayToSecond = 10,
        HourToMinute = 11,
        HourToSecond = 12,
        MinuteToSecond = 13,
    }
    impl IntervalType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                IntervalType::Unspecified => "UNSPECIFIED",
                IntervalType::Year => "YEAR",
                IntervalType::Month => "MONTH",
                IntervalType::Day => "DAY",
                IntervalType::Hour => "HOUR",
                IntervalType::Minute => "MINUTE",
                IntervalType::Second => "SECOND",
                IntervalType::YearToMonth => "YEAR_TO_MONTH",
                IntervalType::DayToHour => "DAY_TO_HOUR",
                IntervalType::DayToMinute => "DAY_TO_MINUTE",
                IntervalType::DayToSecond => "DAY_TO_SECOND",
                IntervalType::HourToMinute => "HOUR_TO_MINUTE",
                IntervalType::HourToSecond => "HOUR_TO_SECOND",
                IntervalType::MinuteToSecond => "MINUTE_TO_SECOND",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "UNSPECIFIED" => Some(Self::Unspecified),
                "YEAR" => Some(Self::Year),
                "MONTH" => Some(Self::Month),
                "DAY" => Some(Self::Day),
                "HOUR" => Some(Self::Hour),
                "MINUTE" => Some(Self::Minute),
                "SECOND" => Some(Self::Second),
                "YEAR_TO_MONTH" => Some(Self::YearToMonth),
                "DAY_TO_HOUR" => Some(Self::DayToHour),
                "DAY_TO_MINUTE" => Some(Self::DayToMinute),
                "DAY_TO_SECOND" => Some(Self::DayToSecond),
                "HOUR_TO_MINUTE" => Some(Self::HourToMinute),
                "HOUR_TO_SECOND" => Some(Self::HourToSecond),
                "MINUTE_TO_SECOND" => Some(Self::MinuteToSecond),
                _ => None,
            }
        }
    }
    #[derive(prost_helpers::AnyPB)]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum TypeName {
        TypeUnspecified = 0,
        Int16 = 1,
        Int32 = 2,
        Int64 = 3,
        Float = 4,
        Double = 5,
        Boolean = 6,
        Varchar = 7,
        Decimal = 8,
        Time = 9,
        Timestamp = 10,
        Interval = 11,
        Date = 12,
        /// Timestamp type with timezone
        Timestamptz = 13,
        Struct = 15,
        List = 16,
        Bytea = 17,
        Jsonb = 18,
        Serial = 19,
        Int256 = 20,
        Map = 21,
    }
    impl TypeName {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                TypeName::TypeUnspecified => "TYPE_UNSPECIFIED",
                TypeName::Int16 => "INT16",
                TypeName::Int32 => "INT32",
                TypeName::Int64 => "INT64",
                TypeName::Float => "FLOAT",
                TypeName::Double => "DOUBLE",
                TypeName::Boolean => "BOOLEAN",
                TypeName::Varchar => "VARCHAR",
                TypeName::Decimal => "DECIMAL",
                TypeName::Time => "TIME",
                TypeName::Timestamp => "TIMESTAMP",
                TypeName::Interval => "INTERVAL",
                TypeName::Date => "DATE",
                TypeName::Timestamptz => "TIMESTAMPTZ",
                TypeName::Struct => "STRUCT",
                TypeName::List => "LIST",
                TypeName::Bytea => "BYTEA",
                TypeName::Jsonb => "JSONB",
                TypeName::Serial => "SERIAL",
                TypeName::Int256 => "INT256",
                TypeName::Map => "MAP",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "TYPE_UNSPECIFIED" => Some(Self::TypeUnspecified),
                "INT16" => Some(Self::Int16),
                "INT32" => Some(Self::Int32),
                "INT64" => Some(Self::Int64),
                "FLOAT" => Some(Self::Float),
                "DOUBLE" => Some(Self::Double),
                "BOOLEAN" => Some(Self::Boolean),
                "VARCHAR" => Some(Self::Varchar),
                "DECIMAL" => Some(Self::Decimal),
                "TIME" => Some(Self::Time),
                "TIMESTAMP" => Some(Self::Timestamp),
                "INTERVAL" => Some(Self::Interval),
                "DATE" => Some(Self::Date),
                "TIMESTAMPTZ" => Some(Self::Timestamptz),
                "STRUCT" => Some(Self::Struct),
                "LIST" => Some(Self::List),
                "BYTEA" => Some(Self::Bytea),
                "JSONB" => Some(Self::Jsonb),
                "SERIAL" => Some(Self::Serial),
                "INT256" => Some(Self::Int256),
                "MAP" => Some(Self::Map),
                _ => None,
            }
        }
    }
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StructArrayData {
    #[prost(message, repeated, tag = "1")]
    pub children_array: ::prost::alloc::vec::Vec<Array>,
    #[prost(message, repeated, tag = "2")]
    pub children_type: ::prost::alloc::vec::Vec<DataType>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListArrayData {
    #[prost(uint32, repeated, tag = "1")]
    pub offsets: ::prost::alloc::vec::Vec<u32>,
    #[prost(message, optional, boxed, tag = "2")]
    pub value: ::core::option::Option<::prost::alloc::boxed::Box<Array>>,
    #[prost(message, optional, tag = "3")]
    pub value_type: ::core::option::Option<DataType>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Array {
    #[prost(enumeration = "ArrayType", tag = "1")]
    pub array_type: i32,
    #[prost(message, optional, tag = "2")]
    pub null_bitmap: ::core::option::Option<super::common::Buffer>,
    #[prost(message, repeated, tag = "3")]
    pub values: ::prost::alloc::vec::Vec<super::common::Buffer>,
    #[prost(message, optional, tag = "4")]
    pub struct_array_data: ::core::option::Option<StructArrayData>,
    #[prost(message, optional, boxed, tag = "5")]
    pub list_array_data: ::core::option::Option<
        ::prost::alloc::boxed::Box<ListArrayData>,
    >,
}
#[derive(prost_helpers::AnyPB)]
#[derive(Eq, Hash)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Datum {
    /// bool array/bitmap: one byte, 0 for false (null), non-zero for true (non-null)
    /// integer, float,  double: big-endianness
    /// interval: encoded to (months, days, milliseconds), big-endianness
    /// varchar: encoded accorded to encoding, currently only utf8 is supported.
    #[prost(bytes = "vec", tag = "1")]
    pub body: ::prost::alloc::vec::Vec<u8>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataChunk {
    #[prost(uint32, tag = "1")]
    pub cardinality: u32,
    #[prost(message, repeated, tag = "2")]
    pub columns: ::prost::alloc::vec::Vec<Array>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamChunk {
    /// for Array::from_protobuf(), may not need later
    #[prost(uint32, tag = "1")]
    pub cardinality: u32,
    #[prost(enumeration = "Op", repeated, tag = "2")]
    pub ops: ::prost::alloc::vec::Vec<i32>,
    #[prost(message, repeated, tag = "3")]
    pub columns: ::prost::alloc::vec::Vec<Array>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Epoch {
    #[prost(uint64, tag = "1")]
    pub curr: u64,
    #[prost(uint64, tag = "2")]
    pub prev: u64,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Terminate {}
#[derive(prost_helpers::AnyPB)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ArrayType {
    Unspecified = 0,
    Int16 = 1,
    Int32 = 2,
    Int64 = 3,
    Float32 = 4,
    Float64 = 5,
    Utf8 = 6,
    Bool = 7,
    Decimal = 8,
    Date = 9,
    Time = 10,
    Timestamp = 11,
    Timestamptz = 19,
    Interval = 12,
    Struct = 13,
    List = 14,
    Bytea = 15,
    Jsonb = 16,
    Serial = 17,
    Int256 = 18,
    Map = 20,
}
impl ArrayType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            ArrayType::Unspecified => "UNSPECIFIED",
            ArrayType::Int16 => "INT16",
            ArrayType::Int32 => "INT32",
            ArrayType::Int64 => "INT64",
            ArrayType::Float32 => "FLOAT32",
            ArrayType::Float64 => "FLOAT64",
            ArrayType::Utf8 => "UTF8",
            ArrayType::Bool => "BOOL",
            ArrayType::Decimal => "DECIMAL",
            ArrayType::Date => "DATE",
            ArrayType::Time => "TIME",
            ArrayType::Timestamp => "TIMESTAMP",
            ArrayType::Timestamptz => "TIMESTAMPTZ",
            ArrayType::Interval => "INTERVAL",
            ArrayType::Struct => "STRUCT",
            ArrayType::List => "LIST",
            ArrayType::Bytea => "BYTEA",
            ArrayType::Jsonb => "JSONB",
            ArrayType::Serial => "SERIAL",
            ArrayType::Int256 => "INT256",
            ArrayType::Map => "MAP",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "UNSPECIFIED" => Some(Self::Unspecified),
            "INT16" => Some(Self::Int16),
            "INT32" => Some(Self::Int32),
            "INT64" => Some(Self::Int64),
            "FLOAT32" => Some(Self::Float32),
            "FLOAT64" => Some(Self::Float64),
            "UTF8" => Some(Self::Utf8),
            "BOOL" => Some(Self::Bool),
            "DECIMAL" => Some(Self::Decimal),
            "DATE" => Some(Self::Date),
            "TIME" => Some(Self::Time),
            "TIMESTAMP" => Some(Self::Timestamp),
            "TIMESTAMPTZ" => Some(Self::Timestamptz),
            "INTERVAL" => Some(Self::Interval),
            "STRUCT" => Some(Self::Struct),
            "LIST" => Some(Self::List),
            "BYTEA" => Some(Self::Bytea),
            "JSONB" => Some(Self::Jsonb),
            "SERIAL" => Some(Self::Serial),
            "INT256" => Some(Self::Int256),
            "MAP" => Some(Self::Map),
            _ => None,
        }
    }
}
#[derive(prost_helpers::AnyPB)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Op {
    Unspecified = 0,
    Insert = 1,
    Delete = 2,
    UpdateInsert = 3,
    UpdateDelete = 4,
}
impl Op {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Op::Unspecified => "OP_UNSPECIFIED",
            Op::Insert => "INSERT",
            Op::Delete => "DELETE",
            Op::UpdateInsert => "UPDATE_INSERT",
            Op::UpdateDelete => "UPDATE_DELETE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "OP_UNSPECIFIED" => Some(Self::Unspecified),
            "INSERT" => Some(Self::Insert),
            "DELETE" => Some(Self::Delete),
            "UPDATE_INSERT" => Some(Self::UpdateInsert),
            "UPDATE_DELETE" => Some(Self::UpdateDelete),
            _ => None,
        }
    }
}