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
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtoRow {
#[prost(message, repeated, tag = "1")]
pub datums: ::prost::alloc::vec::Vec<ProtoDatum>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtoDatum {
/// NB: Proto oneof ids `1..=15` get encoded in 1 byte and so we should
/// reserve them for the datum types we expect to be most popular.
///
/// Null, False, and True are all likely to be frequent, but the encoded
/// length is exactly the same if they're here or in ProtoDatumOther. In
/// general, anything that can be encoded purely as a proto enum variant
/// (i.e. doesn't have a payload) is better off that way. If we run out of
/// 1-byte encodings of ProtoDatumOther, we can always add ProtoDatumOther2.
#[prost(
oneof = "proto_datum::DatumType",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33"
)]
pub datum_type: ::core::option::Option<proto_datum::DatumType>,
}
/// Nested message and enum types in `ProtoDatum`.
pub mod proto_datum {
/// NB: Proto oneof ids `1..=15` get encoded in 1 byte and so we should
/// reserve them for the datum types we expect to be most popular.
///
/// Null, False, and True are all likely to be frequent, but the encoded
/// length is exactly the same if they're here or in ProtoDatumOther. In
/// general, anything that can be encoded purely as a proto enum variant
/// (i.e. doesn't have a payload) is better off that way. If we run out of
/// 1-byte encodings of ProtoDatumOther, we can always add ProtoDatumOther2.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum DatumType {
#[prost(enumeration = "super::ProtoDatumOther", tag = "1")]
Other(i32),
#[prost(int32, tag = "2")]
Int16(i32),
#[prost(int32, tag = "3")]
Int32(i32),
#[prost(int64, tag = "4")]
Int64(i64),
#[prost(float, tag = "5")]
Float32(f32),
#[prost(double, tag = "6")]
Float64(f64),
#[prost(bytes, tag = "7")]
Bytes(::prost::bytes::Bytes),
/// Don't use 9-15 without truly understanding the NB above.
#[prost(string, tag = "8")]
String(::prost::alloc::string::String),
/// These get encoded with 2 bytes for the oneof id. It's a pretty easy
/// and low-debt migration to "bless" one of these into having a 1-byte
/// id (fill in the new field on write, but check if either field is set
/// on read). However, once a 1-byte id is used, it's gone forever, so
/// we're conservative in handing them out.
///
/// Of these, I'd guess Timestamp and UUID are probably the first ones
/// we'd bless followed by Date and Time.
#[prost(message, tag = "16")]
Date(super::super::adt::date::ProtoDate),
#[prost(message, tag = "17")]
Time(::mz_proto::chrono::ProtoNaiveTime),
#[prost(message, tag = "18")]
Timestamp(::mz_proto::chrono::ProtoNaiveDateTime),
#[prost(message, tag = "19")]
TimestampTz(::mz_proto::chrono::ProtoNaiveDateTime),
#[prost(message, tag = "20")]
Interval(super::super::adt::interval::ProtoInterval),
#[prost(message, tag = "21")]
Array(super::ProtoArray),
#[prost(message, tag = "22")]
List(super::ProtoRow),
#[prost(message, tag = "23")]
Dict(super::ProtoDict),
#[prost(message, tag = "24")]
Numeric(super::ProtoNumeric),
#[prost(bytes, tag = "25")]
Uuid(::prost::alloc::vec::Vec<u8>),
#[prost(uint32, tag = "26")]
Uint32(u32),
#[prost(uint32, tag = "27")]
Uint8(u32),
#[prost(uint32, tag = "28")]
Uint16(u32),
#[prost(uint64, tag = "29")]
Uint64(u64),
#[prost(uint64, tag = "30")]
MzTimestamp(u64),
#[prost(message, tag = "31")]
Range(::prost::alloc::boxed::Box<super::ProtoRange>),
#[prost(message, tag = "32")]
MzAclItem(super::super::adt::mz_acl_item::ProtoMzAclItem),
#[prost(message, tag = "33")]
AclItem(super::super::adt::mz_acl_item::ProtoAclItem),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtoArray {
/// All array elements flattened into 1 dimension, encoded in row-major
/// order.
#[prost(message, optional, tag = "1")]
pub elements: ::core::option::Option<ProtoRow>,
/// A list of metadata for each dimension in the array. Each dimension has a
/// lower bound (the index at which the dimension begins) and the length of
/// the dimension (the number of elements in that dimension). For a 3x4
/// matrix, for example, you'd have two entries in the dims array, the first
/// with length 3 and the second with length 4. ATM the lower bound for each
/// dimension is always 1, but Postgres technically lets you choose any lower
/// bound you like for each dimension.
#[prost(message, repeated, tag = "2")]
pub dims: ::prost::alloc::vec::Vec<ProtoArrayDimension>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ProtoArrayDimension {
#[prost(int64, tag = "1")]
pub lower_bound: i64,
#[prost(uint64, tag = "2")]
pub length: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtoDict {
#[prost(message, repeated, tag = "1")]
pub elements: ::prost::alloc::vec::Vec<ProtoDictElement>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtoDictElement {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub val: ::core::option::Option<ProtoDatum>,
}
/// See \[dec::to_packed_bcd\] and <http://speleotrove.com/decimal/dnpack.html> for
/// more information on this format.
///
/// NB: Special values like NaN, PosInf, and NegInf are represented as variants
/// of ProtoDatumOther.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtoNumeric {
/// A a sequence of Binary Coded Decimal digits, most significant first (at
/// the lowest offset into the byte array) and one per 4 bits (that is, each
/// digit taking a value of 0–9, and two digits per byte), with optional
/// leading zero digits.
#[prost(bytes = "vec", tag = "1")]
pub bcd: ::prost::alloc::vec::Vec<u8>,
/// The number of digits that follow the decimal point.
#[prost(int32, tag = "2")]
pub scale: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtoRangeInner {
#[prost(bool, tag = "1")]
pub lower_inclusive: bool,
#[prost(message, optional, boxed, tag = "2")]
pub lower: ::core::option::Option<::prost::alloc::boxed::Box<ProtoDatum>>,
#[prost(bool, tag = "3")]
pub upper_inclusive: bool,
#[prost(message, optional, boxed, tag = "4")]
pub upper: ::core::option::Option<::prost::alloc::boxed::Box<ProtoDatum>>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtoRange {
#[prost(message, optional, boxed, tag = "1")]
pub inner: ::core::option::Option<::prost::alloc::boxed::Box<ProtoRangeInner>>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProtoDatumOther {
/// It's generally good practice to make id 0 (the default if the field is
/// unset) in proto enums be an Unknown sentinel. This allows for
/// distinguishing between unset and any of the enum variants.
///
/// This enum is initially used only in a oneof, which means we can
/// distinguish unset without this sentinel. But stick one in here anyway,
/// in case this enum gets used somewhere else in the future.
Unknown = 0,
Null = 1,
False = 2,
True = 3,
JsonNull = 4,
Dummy = 5,
NumericPosInf = 6,
NumericNegInf = 7,
NumericNaN = 8,
}
impl ProtoDatumOther {
/// 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 {
ProtoDatumOther::Unknown => "UNKNOWN",
ProtoDatumOther::Null => "NULL",
ProtoDatumOther::False => "FALSE",
ProtoDatumOther::True => "TRUE",
ProtoDatumOther::JsonNull => "JSON_NULL",
ProtoDatumOther::Dummy => "DUMMY",
ProtoDatumOther::NumericPosInf => "NUMERIC_POS_INF",
ProtoDatumOther::NumericNegInf => "NUMERIC_NEG_INF",
ProtoDatumOther::NumericNaN => "NUMERIC_NA_N",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"NULL" => Some(Self::Null),
"FALSE" => Some(Self::False),
"TRUE" => Some(Self::True),
"JSON_NULL" => Some(Self::JsonNull),
"DUMMY" => Some(Self::Dummy),
"NUMERIC_POS_INF" => Some(Self::NumericPosInf),
"NUMERIC_NEG_INF" => Some(Self::NumericNegInf),
"NUMERIC_NA_N" => Some(Self::NumericNaN),
_ => None,
}
}
}