risingwave_pb/
data.rs

1// This file is @generated by prost-build.
2#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct Interval {
5    #[prost(int32, tag = "1")]
6    pub months: i32,
7    #[prost(int32, tag = "2")]
8    pub days: i32,
9    #[prost(int64, tag = "3")]
10    pub usecs: i64,
11}
12#[derive(prost_helpers::AnyPB)]
13#[derive(Eq, Hash)]
14#[derive(Clone, PartialEq, ::prost::Message)]
15#[prost(skip_debug)]
16pub struct DataType {
17    #[prost(enumeration = "data_type::TypeName", tag = "1")]
18    pub type_name: i32,
19    /// Data length for vector.
20    /// Max data length for varchar.
21    /// Precision for time, decimal.
22    #[prost(uint32, tag = "2")]
23    pub precision: u32,
24    /// Scale for decimal.
25    #[prost(uint32, tag = "3")]
26    pub scale: u32,
27    #[prost(bool, tag = "4")]
28    pub is_nullable: bool,
29    #[prost(enumeration = "data_type::IntervalType", tag = "5")]
30    pub interval_type: i32,
31    /// For struct type, it represents all the fields in the struct.
32    /// For list type it only contains 1 element which is the inner item type of the List.
33    /// For example, `ARRAY<INTEGER>` will be represented as `vec!\[DataType::Int32\]`.
34    #[prost(message, repeated, tag = "6")]
35    pub field_type: ::prost::alloc::vec::Vec<DataType>,
36    /// Name of the fields if it is a struct type. For other types it will be empty.
37    #[prost(string, repeated, tag = "7")]
38    pub field_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
39    /// Id of the fields if it is a struct type. Used in serialization for nested-schema evolution purposes.
40    ///
41    /// Empty if either:
42    ///
43    /// * it is not a struct type
44    /// * it is not within a table schema (`ColumnDesc`)
45    /// * it was persisted in an old version.
46    #[prost(int32, repeated, tag = "8")]
47    pub field_ids: ::prost::alloc::vec::Vec<i32>,
48}
49/// Nested message and enum types in `DataType`.
50pub mod data_type {
51    #[derive(prost_helpers::AnyPB)]
52    #[derive(
53        Clone,
54        Copy,
55        Debug,
56        PartialEq,
57        Eq,
58        Hash,
59        PartialOrd,
60        Ord,
61        ::prost::Enumeration
62    )]
63    #[repr(i32)]
64    pub enum IntervalType {
65        Unspecified = 0,
66        Year = 1,
67        Month = 2,
68        Day = 3,
69        Hour = 4,
70        Minute = 5,
71        Second = 6,
72        YearToMonth = 7,
73        DayToHour = 8,
74        DayToMinute = 9,
75        DayToSecond = 10,
76        HourToMinute = 11,
77        HourToSecond = 12,
78        MinuteToSecond = 13,
79    }
80    impl IntervalType {
81        /// String value of the enum field names used in the ProtoBuf definition.
82        ///
83        /// The values are not transformed in any way and thus are considered stable
84        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
85        pub fn as_str_name(&self) -> &'static str {
86            match self {
87                Self::Unspecified => "UNSPECIFIED",
88                Self::Year => "YEAR",
89                Self::Month => "MONTH",
90                Self::Day => "DAY",
91                Self::Hour => "HOUR",
92                Self::Minute => "MINUTE",
93                Self::Second => "SECOND",
94                Self::YearToMonth => "YEAR_TO_MONTH",
95                Self::DayToHour => "DAY_TO_HOUR",
96                Self::DayToMinute => "DAY_TO_MINUTE",
97                Self::DayToSecond => "DAY_TO_SECOND",
98                Self::HourToMinute => "HOUR_TO_MINUTE",
99                Self::HourToSecond => "HOUR_TO_SECOND",
100                Self::MinuteToSecond => "MINUTE_TO_SECOND",
101            }
102        }
103        /// Creates an enum from field names used in the ProtoBuf definition.
104        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
105            match value {
106                "UNSPECIFIED" => Some(Self::Unspecified),
107                "YEAR" => Some(Self::Year),
108                "MONTH" => Some(Self::Month),
109                "DAY" => Some(Self::Day),
110                "HOUR" => Some(Self::Hour),
111                "MINUTE" => Some(Self::Minute),
112                "SECOND" => Some(Self::Second),
113                "YEAR_TO_MONTH" => Some(Self::YearToMonth),
114                "DAY_TO_HOUR" => Some(Self::DayToHour),
115                "DAY_TO_MINUTE" => Some(Self::DayToMinute),
116                "DAY_TO_SECOND" => Some(Self::DayToSecond),
117                "HOUR_TO_MINUTE" => Some(Self::HourToMinute),
118                "HOUR_TO_SECOND" => Some(Self::HourToSecond),
119                "MINUTE_TO_SECOND" => Some(Self::MinuteToSecond),
120                _ => None,
121            }
122        }
123    }
124    #[derive(prost_helpers::AnyPB)]
125    #[derive(
126        Clone,
127        Copy,
128        Debug,
129        PartialEq,
130        Eq,
131        Hash,
132        PartialOrd,
133        Ord,
134        ::prost::Enumeration
135    )]
136    #[repr(i32)]
137    pub enum TypeName {
138        TypeUnspecified = 0,
139        Int16 = 1,
140        Int32 = 2,
141        Int64 = 3,
142        Float = 4,
143        Double = 5,
144        Boolean = 6,
145        Varchar = 7,
146        Decimal = 8,
147        Time = 9,
148        Timestamp = 10,
149        Interval = 11,
150        Date = 12,
151        /// Timestamp type with timezone
152        Timestamptz = 13,
153        Struct = 15,
154        List = 16,
155        Bytea = 17,
156        Jsonb = 18,
157        Serial = 19,
158        Int256 = 20,
159        Map = 21,
160        Vector = 22,
161    }
162    impl TypeName {
163        /// String value of the enum field names used in the ProtoBuf definition.
164        ///
165        /// The values are not transformed in any way and thus are considered stable
166        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
167        pub fn as_str_name(&self) -> &'static str {
168            match self {
169                Self::TypeUnspecified => "TYPE_UNSPECIFIED",
170                Self::Int16 => "INT16",
171                Self::Int32 => "INT32",
172                Self::Int64 => "INT64",
173                Self::Float => "FLOAT",
174                Self::Double => "DOUBLE",
175                Self::Boolean => "BOOLEAN",
176                Self::Varchar => "VARCHAR",
177                Self::Decimal => "DECIMAL",
178                Self::Time => "TIME",
179                Self::Timestamp => "TIMESTAMP",
180                Self::Interval => "INTERVAL",
181                Self::Date => "DATE",
182                Self::Timestamptz => "TIMESTAMPTZ",
183                Self::Struct => "STRUCT",
184                Self::List => "LIST",
185                Self::Bytea => "BYTEA",
186                Self::Jsonb => "JSONB",
187                Self::Serial => "SERIAL",
188                Self::Int256 => "INT256",
189                Self::Map => "MAP",
190                Self::Vector => "VECTOR",
191            }
192        }
193        /// Creates an enum from field names used in the ProtoBuf definition.
194        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
195            match value {
196                "TYPE_UNSPECIFIED" => Some(Self::TypeUnspecified),
197                "INT16" => Some(Self::Int16),
198                "INT32" => Some(Self::Int32),
199                "INT64" => Some(Self::Int64),
200                "FLOAT" => Some(Self::Float),
201                "DOUBLE" => Some(Self::Double),
202                "BOOLEAN" => Some(Self::Boolean),
203                "VARCHAR" => Some(Self::Varchar),
204                "DECIMAL" => Some(Self::Decimal),
205                "TIME" => Some(Self::Time),
206                "TIMESTAMP" => Some(Self::Timestamp),
207                "INTERVAL" => Some(Self::Interval),
208                "DATE" => Some(Self::Date),
209                "TIMESTAMPTZ" => Some(Self::Timestamptz),
210                "STRUCT" => Some(Self::Struct),
211                "LIST" => Some(Self::List),
212                "BYTEA" => Some(Self::Bytea),
213                "JSONB" => Some(Self::Jsonb),
214                "SERIAL" => Some(Self::Serial),
215                "INT256" => Some(Self::Int256),
216                "MAP" => Some(Self::Map),
217                "VECTOR" => Some(Self::Vector),
218                _ => None,
219            }
220        }
221    }
222}
223#[derive(prost_helpers::AnyPB)]
224#[derive(Clone, PartialEq, ::prost::Message)]
225pub struct StructArrayData {
226    #[prost(message, repeated, tag = "1")]
227    pub children_array: ::prost::alloc::vec::Vec<Array>,
228    #[prost(message, repeated, tag = "2")]
229    pub children_type: ::prost::alloc::vec::Vec<DataType>,
230}
231#[derive(prost_helpers::AnyPB)]
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct ListArrayData {
234    #[prost(uint32, repeated, tag = "1")]
235    pub offsets: ::prost::alloc::vec::Vec<u32>,
236    #[prost(message, optional, boxed, tag = "2")]
237    pub value: ::core::option::Option<::prost::alloc::boxed::Box<Array>>,
238    #[prost(message, optional, tag = "3")]
239    pub value_type: ::core::option::Option<DataType>,
240    /// See `DataType::precision`
241    /// Shall we embed `DataType` in `Array` directly?
242    #[prost(uint32, optional, tag = "4")]
243    pub elem_size: ::core::option::Option<u32>,
244}
245#[derive(prost_helpers::AnyPB)]
246#[derive(Clone, PartialEq, ::prost::Message)]
247pub struct Array {
248    #[prost(enumeration = "ArrayType", tag = "1")]
249    pub array_type: i32,
250    #[prost(message, optional, tag = "2")]
251    pub null_bitmap: ::core::option::Option<super::common::Buffer>,
252    #[prost(message, repeated, tag = "3")]
253    pub values: ::prost::alloc::vec::Vec<super::common::Buffer>,
254    #[prost(message, optional, tag = "4")]
255    pub struct_array_data: ::core::option::Option<StructArrayData>,
256    #[prost(message, optional, boxed, tag = "5")]
257    pub list_array_data: ::core::option::Option<
258        ::prost::alloc::boxed::Box<ListArrayData>,
259    >,
260}
261#[derive(prost_helpers::AnyPB)]
262#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
263pub struct Datum {
264    /// bool array/bitmap: one byte, 0 for false (null), non-zero for true (non-null)
265    /// integer, float,  double: big-endianness
266    /// interval: encoded to (months, days, milliseconds), big-endianness
267    /// varchar: encoded accorded to encoding, currently only utf8 is supported.
268    #[prost(bytes = "vec", tag = "1")]
269    pub body: ::prost::alloc::vec::Vec<u8>,
270}
271#[derive(prost_helpers::AnyPB)]
272#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct DataChunk {
274    #[prost(uint32, tag = "1")]
275    pub cardinality: u32,
276    #[prost(message, repeated, tag = "2")]
277    pub columns: ::prost::alloc::vec::Vec<Array>,
278}
279#[derive(prost_helpers::AnyPB)]
280#[derive(Clone, PartialEq, ::prost::Message)]
281pub struct StreamChunk {
282    /// for Array::from_protobuf(), may not need later
283    #[prost(uint32, tag = "1")]
284    pub cardinality: u32,
285    #[prost(enumeration = "Op", repeated, tag = "2")]
286    pub ops: ::prost::alloc::vec::Vec<i32>,
287    #[prost(message, repeated, tag = "3")]
288    pub columns: ::prost::alloc::vec::Vec<Array>,
289}
290#[derive(prost_helpers::AnyPB)]
291#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
292pub struct Epoch {
293    #[prost(uint64, tag = "1")]
294    pub curr: u64,
295    #[prost(uint64, tag = "2")]
296    pub prev: u64,
297}
298#[derive(prost_helpers::AnyPB)]
299#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
300pub struct Terminate {}
301#[derive(prost_helpers::AnyPB)]
302#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
303#[repr(i32)]
304pub enum ArrayType {
305    Unspecified = 0,
306    Int16 = 1,
307    Int32 = 2,
308    Int64 = 3,
309    Float32 = 4,
310    Float64 = 5,
311    Utf8 = 6,
312    Bool = 7,
313    Decimal = 8,
314    Date = 9,
315    Time = 10,
316    Timestamp = 11,
317    Timestamptz = 19,
318    Interval = 12,
319    Struct = 13,
320    List = 14,
321    Bytea = 15,
322    Jsonb = 16,
323    Serial = 17,
324    Int256 = 18,
325    Map = 20,
326    Vector = 21,
327}
328impl ArrayType {
329    /// String value of the enum field names used in the ProtoBuf definition.
330    ///
331    /// The values are not transformed in any way and thus are considered stable
332    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
333    pub fn as_str_name(&self) -> &'static str {
334        match self {
335            Self::Unspecified => "UNSPECIFIED",
336            Self::Int16 => "INT16",
337            Self::Int32 => "INT32",
338            Self::Int64 => "INT64",
339            Self::Float32 => "FLOAT32",
340            Self::Float64 => "FLOAT64",
341            Self::Utf8 => "UTF8",
342            Self::Bool => "BOOL",
343            Self::Decimal => "DECIMAL",
344            Self::Date => "DATE",
345            Self::Time => "TIME",
346            Self::Timestamp => "TIMESTAMP",
347            Self::Timestamptz => "TIMESTAMPTZ",
348            Self::Interval => "INTERVAL",
349            Self::Struct => "STRUCT",
350            Self::List => "LIST",
351            Self::Bytea => "BYTEA",
352            Self::Jsonb => "JSONB",
353            Self::Serial => "SERIAL",
354            Self::Int256 => "INT256",
355            Self::Map => "MAP",
356            Self::Vector => "VECTOR",
357        }
358    }
359    /// Creates an enum from field names used in the ProtoBuf definition.
360    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
361        match value {
362            "UNSPECIFIED" => Some(Self::Unspecified),
363            "INT16" => Some(Self::Int16),
364            "INT32" => Some(Self::Int32),
365            "INT64" => Some(Self::Int64),
366            "FLOAT32" => Some(Self::Float32),
367            "FLOAT64" => Some(Self::Float64),
368            "UTF8" => Some(Self::Utf8),
369            "BOOL" => Some(Self::Bool),
370            "DECIMAL" => Some(Self::Decimal),
371            "DATE" => Some(Self::Date),
372            "TIME" => Some(Self::Time),
373            "TIMESTAMP" => Some(Self::Timestamp),
374            "TIMESTAMPTZ" => Some(Self::Timestamptz),
375            "INTERVAL" => Some(Self::Interval),
376            "STRUCT" => Some(Self::Struct),
377            "LIST" => Some(Self::List),
378            "BYTEA" => Some(Self::Bytea),
379            "JSONB" => Some(Self::Jsonb),
380            "SERIAL" => Some(Self::Serial),
381            "INT256" => Some(Self::Int256),
382            "MAP" => Some(Self::Map),
383            "VECTOR" => Some(Self::Vector),
384            _ => None,
385        }
386    }
387}
388#[derive(prost_helpers::AnyPB)]
389#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
390#[repr(i32)]
391pub enum Op {
392    Unspecified = 0,
393    Insert = 1,
394    Delete = 2,
395    UpdateInsert = 3,
396    UpdateDelete = 4,
397}
398impl Op {
399    /// String value of the enum field names used in the ProtoBuf definition.
400    ///
401    /// The values are not transformed in any way and thus are considered stable
402    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
403    pub fn as_str_name(&self) -> &'static str {
404        match self {
405            Self::Unspecified => "OP_UNSPECIFIED",
406            Self::Insert => "INSERT",
407            Self::Delete => "DELETE",
408            Self::UpdateInsert => "UPDATE_INSERT",
409            Self::UpdateDelete => "UPDATE_DELETE",
410        }
411    }
412    /// Creates an enum from field names used in the ProtoBuf definition.
413    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
414        match value {
415            "OP_UNSPECIFIED" => Some(Self::Unspecified),
416            "INSERT" => Some(Self::Insert),
417            "DELETE" => Some(Self::Delete),
418            "UPDATE_INSERT" => Some(Self::UpdateInsert),
419            "UPDATE_DELETE" => Some(Self::UpdateDelete),
420            _ => None,
421        }
422    }
423}