Skip to main content

risingwave_pb/
data.rs

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