Skip to main content

substrait/opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/substrait-704a5dee010942fc/out/
substrait.rs

1// This file is @generated by prost-build.
2/// Note: type_variation_reference fields within Type messages reference a
3/// type_variation_anchor defined in the plan's extension declarations.
4///
5/// The value 0 represents the system-preferred variation and is a valid reference value.
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct Type {
8    #[prost(
9        oneof = "r#type::Kind",
10        tags = "1, 2, 3, 5, 7, 10, 11, 12, 13, 14, 16, 17, 19, 20, 35, 29, 32, 21, 22, 23, 24, 36, 33, 34, 25, 27, 28, 38, 30, 31, 37"
11    )]
12    pub kind: ::core::option::Option<r#type::Kind>,
13}
14/// Nested message and enum types in `Type`.
15pub mod r#type {
16    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
17    pub struct Boolean {
18        #[prost(uint32, tag = "1")]
19        pub type_variation_reference: u32,
20        #[prost(enumeration = "Nullability", tag = "2")]
21        pub nullability: i32,
22    }
23    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
24    pub struct I8 {
25        #[prost(uint32, tag = "1")]
26        pub type_variation_reference: u32,
27        #[prost(enumeration = "Nullability", tag = "2")]
28        pub nullability: i32,
29    }
30    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
31    pub struct I16 {
32        #[prost(uint32, tag = "1")]
33        pub type_variation_reference: u32,
34        #[prost(enumeration = "Nullability", tag = "2")]
35        pub nullability: i32,
36    }
37    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
38    pub struct I32 {
39        #[prost(uint32, tag = "1")]
40        pub type_variation_reference: u32,
41        #[prost(enumeration = "Nullability", tag = "2")]
42        pub nullability: i32,
43    }
44    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
45    pub struct I64 {
46        #[prost(uint32, tag = "1")]
47        pub type_variation_reference: u32,
48        #[prost(enumeration = "Nullability", tag = "2")]
49        pub nullability: i32,
50    }
51    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
52    pub struct Fp32 {
53        #[prost(uint32, tag = "1")]
54        pub type_variation_reference: u32,
55        #[prost(enumeration = "Nullability", tag = "2")]
56        pub nullability: i32,
57    }
58    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
59    pub struct Fp64 {
60        #[prost(uint32, tag = "1")]
61        pub type_variation_reference: u32,
62        #[prost(enumeration = "Nullability", tag = "2")]
63        pub nullability: i32,
64    }
65    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
66    pub struct String {
67        #[prost(uint32, tag = "1")]
68        pub type_variation_reference: u32,
69        #[prost(enumeration = "Nullability", tag = "2")]
70        pub nullability: i32,
71    }
72    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
73    pub struct Binary {
74        #[prost(uint32, tag = "1")]
75        pub type_variation_reference: u32,
76        #[prost(enumeration = "Nullability", tag = "2")]
77        pub nullability: i32,
78    }
79    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
80    pub struct Timestamp {
81        #[prost(uint32, tag = "1")]
82        pub type_variation_reference: u32,
83        #[prost(enumeration = "Nullability", tag = "2")]
84        pub nullability: i32,
85    }
86    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
87    pub struct Date {
88        #[prost(uint32, tag = "1")]
89        pub type_variation_reference: u32,
90        #[prost(enumeration = "Nullability", tag = "2")]
91        pub nullability: i32,
92    }
93    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
94    pub struct Time {
95        #[prost(uint32, tag = "1")]
96        pub type_variation_reference: u32,
97        #[prost(enumeration = "Nullability", tag = "2")]
98        pub nullability: i32,
99    }
100    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
101    pub struct TimestampTz {
102        #[prost(uint32, tag = "1")]
103        pub type_variation_reference: u32,
104        #[prost(enumeration = "Nullability", tag = "2")]
105        pub nullability: i32,
106    }
107    /// An interval consisting of years and months
108    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
109    pub struct IntervalYear {
110        #[prost(uint32, tag = "1")]
111        pub type_variation_reference: u32,
112        #[prost(enumeration = "Nullability", tag = "2")]
113        pub nullability: i32,
114    }
115    /// An interval consisting of days, seconds, and microseconds
116    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
117    pub struct IntervalDay {
118        #[prost(uint32, tag = "1")]
119        pub type_variation_reference: u32,
120        #[prost(enumeration = "Nullability", tag = "2")]
121        pub nullability: i32,
122        /// Sub-second precision, 0 means the value given is in seconds, 3 is milliseconds, 6 microseconds, 9 is nanoseconds, etc.
123        /// if unset, treat as 6.
124        #[prost(int32, optional, tag = "3")]
125        pub precision: ::core::option::Option<i32>,
126    }
127    /// An interval consisting of the components of both IntervalYear and IntervalDay
128    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
129    pub struct IntervalCompound {
130        #[prost(uint32, tag = "1")]
131        pub type_variation_reference: u32,
132        #[prost(enumeration = "Nullability", tag = "2")]
133        pub nullability: i32,
134        /// Sub-second precision, 0 means the value given is in seconds, 3 is milliseconds, 6 microseconds, 9 is nanoseconds, etc.
135        #[prost(int32, tag = "3")]
136        pub precision: i32,
137    }
138    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
139    pub struct Uuid {
140        #[prost(uint32, tag = "1")]
141        pub type_variation_reference: u32,
142        #[prost(enumeration = "Nullability", tag = "2")]
143        pub nullability: i32,
144    }
145    /// Start compound types.
146    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
147    pub struct FixedChar {
148        #[prost(int32, tag = "1")]
149        pub length: i32,
150        #[prost(uint32, tag = "2")]
151        pub type_variation_reference: u32,
152        #[prost(enumeration = "Nullability", tag = "3")]
153        pub nullability: i32,
154    }
155    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
156    pub struct VarChar {
157        #[prost(int32, tag = "1")]
158        pub length: i32,
159        #[prost(uint32, tag = "2")]
160        pub type_variation_reference: u32,
161        #[prost(enumeration = "Nullability", tag = "3")]
162        pub nullability: i32,
163    }
164    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
165    pub struct FixedBinary {
166        #[prost(int32, tag = "1")]
167        pub length: i32,
168        #[prost(uint32, tag = "2")]
169        pub type_variation_reference: u32,
170        #[prost(enumeration = "Nullability", tag = "3")]
171        pub nullability: i32,
172    }
173    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
174    pub struct Decimal {
175        #[prost(int32, tag = "1")]
176        pub scale: i32,
177        #[prost(int32, tag = "2")]
178        pub precision: i32,
179        #[prost(uint32, tag = "3")]
180        pub type_variation_reference: u32,
181        #[prost(enumeration = "Nullability", tag = "4")]
182        pub nullability: i32,
183    }
184    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
185    pub struct PrecisionTime {
186        /// Sub-second precision, 0 means the value given is in seconds, 3 is milliseconds, 6 microseconds, 9 is nanoseconds, 12 is picoseconds
187        #[prost(int32, tag = "1")]
188        pub precision: i32,
189        #[prost(uint32, tag = "2")]
190        pub type_variation_reference: u32,
191        #[prost(enumeration = "Nullability", tag = "3")]
192        pub nullability: i32,
193    }
194    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
195    pub struct PrecisionTimestamp {
196        /// Sub-second precision, 0 means the value given is in seconds, 3 is milliseconds, 6 microseconds, 9 is nanoseconds, 12 is picoseconds
197        #[prost(int32, tag = "1")]
198        pub precision: i32,
199        #[prost(uint32, tag = "2")]
200        pub type_variation_reference: u32,
201        #[prost(enumeration = "Nullability", tag = "3")]
202        pub nullability: i32,
203    }
204    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
205    pub struct PrecisionTimestampTz {
206        /// Sub-second precision, 0 means the value given is in seconds, 3 is milliseconds, 6 microseconds, 9 is nanoseconds, 12 is picoseconds
207        #[prost(int32, tag = "1")]
208        pub precision: i32,
209        #[prost(uint32, tag = "2")]
210        pub type_variation_reference: u32,
211        #[prost(enumeration = "Nullability", tag = "3")]
212        pub nullability: i32,
213    }
214    #[derive(Clone, PartialEq, ::prost::Message)]
215    pub struct Struct {
216        #[prost(message, repeated, tag = "1")]
217        pub types: ::prost::alloc::vec::Vec<super::Type>,
218        #[prost(uint32, tag = "2")]
219        pub type_variation_reference: u32,
220        #[prost(enumeration = "Nullability", tag = "3")]
221        pub nullability: i32,
222    }
223    #[derive(Clone, PartialEq, ::prost::Message)]
224    pub struct List {
225        #[prost(message, optional, boxed, tag = "1")]
226        pub r#type: ::core::option::Option<::prost::alloc::boxed::Box<super::Type>>,
227        #[prost(uint32, tag = "2")]
228        pub type_variation_reference: u32,
229        #[prost(enumeration = "Nullability", tag = "3")]
230        pub nullability: i32,
231    }
232    #[derive(Clone, PartialEq, ::prost::Message)]
233    pub struct Map {
234        #[prost(message, optional, boxed, tag = "1")]
235        pub key: ::core::option::Option<::prost::alloc::boxed::Box<super::Type>>,
236        #[prost(message, optional, boxed, tag = "2")]
237        pub value: ::core::option::Option<::prost::alloc::boxed::Box<super::Type>>,
238        #[prost(uint32, tag = "3")]
239        pub type_variation_reference: u32,
240        #[prost(enumeration = "Nullability", tag = "4")]
241        pub nullability: i32,
242    }
243    /// A function type for higher-order functions.
244    /// Represents a function that takes parameters of specified types and
245    /// returns a value of a specified type.
246    #[derive(Clone, PartialEq, ::prost::Message)]
247    pub struct Func {
248        /// Types of parameters this function type accepts.
249        #[prost(message, repeated, tag = "1")]
250        pub parameter_types: ::prost::alloc::vec::Vec<super::Type>,
251        /// Return type of the function.
252        #[prost(message, optional, boxed, tag = "2")]
253        pub return_type: ::core::option::Option<::prost::alloc::boxed::Box<super::Type>>,
254        /// Nullability of the function value itself, not its return type.
255        /// A nullable function type (e.g., func?<i32 -> i32>) means the function
256        /// reference may be null. This is distinct from the return type's
257        /// nullability (e.g., func<i32 -> i32?> where the function always exists
258        /// but may return null).
259        #[prost(enumeration = "Nullability", tag = "3")]
260        pub nullability: i32,
261    }
262    #[derive(Clone, PartialEq, ::prost::Message)]
263    pub struct UserDefined {
264        /// References a type_anchor defined in the plan's extension declarations.
265        #[prost(uint32, tag = "1")]
266        pub type_reference: u32,
267        #[prost(uint32, tag = "2")]
268        pub type_variation_reference: u32,
269        #[prost(enumeration = "Nullability", tag = "3")]
270        pub nullability: i32,
271        #[prost(message, repeated, tag = "4")]
272        pub type_parameters: ::prost::alloc::vec::Vec<Parameter>,
273    }
274    #[derive(Clone, PartialEq, ::prost::Message)]
275    pub struct Parameter {
276        #[prost(oneof = "parameter::Parameter", tags = "1, 2, 3, 4, 5, 6")]
277        pub parameter: ::core::option::Option<parameter::Parameter>,
278    }
279    /// Nested message and enum types in `Parameter`.
280    pub mod parameter {
281        #[derive(Clone, PartialEq, ::prost::Oneof)]
282        pub enum Parameter {
283            /// Explicitly null/unspecified parameter, to select the default value (if
284            /// any).
285            #[prost(message, tag = "1")]
286            Null(::pbjson_types::Empty),
287            /// Data type parameters, like the i32 in LIST<i32>.
288            #[prost(message, tag = "2")]
289            DataType(super::super::Type),
290            /// Value parameters, like the 10 in VARCHAR<10>.
291            #[prost(bool, tag = "3")]
292            Boolean(bool),
293            #[prost(int64, tag = "4")]
294            Integer(i64),
295            #[prost(string, tag = "5")]
296            Enum(::prost::alloc::string::String),
297            #[prost(string, tag = "6")]
298            String(::prost::alloc::string::String),
299        }
300    }
301    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
302    pub struct TypeAliasReference {
303        #[prost(uint32, tag = "1")]
304        pub type_alias_reference: u32,
305        /// Nullability of the referenced type alias. Must be specified.
306        #[prost(enumeration = "Nullability", tag = "2")]
307        pub nullability: i32,
308    }
309    #[derive(
310        Clone,
311        Copy,
312        Debug,
313        PartialEq,
314        Eq,
315        Hash,
316        PartialOrd,
317        Ord,
318        ::prost::Enumeration
319    )]
320    #[repr(i32)]
321    pub enum Nullability {
322        Unspecified = 0,
323        Nullable = 1,
324        Required = 2,
325    }
326    impl Nullability {
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 => "NULLABILITY_UNSPECIFIED",
334                Self::Nullable => "NULLABILITY_NULLABLE",
335                Self::Required => "NULLABILITY_REQUIRED",
336            }
337        }
338        /// Creates an enum from field names used in the ProtoBuf definition.
339        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
340            match value {
341                "NULLABILITY_UNSPECIFIED" => Some(Self::Unspecified),
342                "NULLABILITY_NULLABLE" => Some(Self::Nullable),
343                "NULLABILITY_REQUIRED" => Some(Self::Required),
344                _ => None,
345            }
346        }
347    }
348    #[derive(Clone, PartialEq, ::prost::Oneof)]
349    pub enum Kind {
350        #[prost(message, tag = "1")]
351        Bool(Boolean),
352        #[prost(message, tag = "2")]
353        I8(I8),
354        #[prost(message, tag = "3")]
355        I16(I16),
356        #[prost(message, tag = "5")]
357        I32(I32),
358        #[prost(message, tag = "7")]
359        I64(I64),
360        #[prost(message, tag = "10")]
361        Fp32(Fp32),
362        #[prost(message, tag = "11")]
363        Fp64(Fp64),
364        #[prost(message, tag = "12")]
365        String(String),
366        #[prost(message, tag = "13")]
367        Binary(Binary),
368        /// Deprecated in favor of `PrecisionTimestamp precision_timestamp`
369        #[prost(message, tag = "14")]
370        Timestamp(Timestamp),
371        #[prost(message, tag = "16")]
372        Date(Date),
373        /// Deprecated in favor of `PrecisionTime precision_time`
374        #[prost(message, tag = "17")]
375        Time(Time),
376        #[prost(message, tag = "19")]
377        IntervalYear(IntervalYear),
378        #[prost(message, tag = "20")]
379        IntervalDay(IntervalDay),
380        #[prost(message, tag = "35")]
381        IntervalCompound(IntervalCompound),
382        /// Deprecated in favor of `PrecisionTimestampTZ precision_timestamp_tz`
383        #[prost(message, tag = "29")]
384        TimestampTz(TimestampTz),
385        #[prost(message, tag = "32")]
386        Uuid(Uuid),
387        #[prost(message, tag = "21")]
388        FixedChar(FixedChar),
389        #[prost(message, tag = "22")]
390        Varchar(VarChar),
391        #[prost(message, tag = "23")]
392        FixedBinary(FixedBinary),
393        #[prost(message, tag = "24")]
394        Decimal(Decimal),
395        #[prost(message, tag = "36")]
396        PrecisionTime(PrecisionTime),
397        #[prost(message, tag = "33")]
398        PrecisionTimestamp(PrecisionTimestamp),
399        /// value is since UNIX epoch in UTC
400        #[prost(message, tag = "34")]
401        PrecisionTimestampTz(PrecisionTimestampTz),
402        #[prost(message, tag = "25")]
403        Struct(Struct),
404        #[prost(message, tag = "27")]
405        List(::prost::alloc::boxed::Box<List>),
406        #[prost(message, tag = "28")]
407        Map(::prost::alloc::boxed::Box<Map>),
408        #[prost(message, tag = "38")]
409        Func(::prost::alloc::boxed::Box<Func>),
410        #[prost(message, tag = "30")]
411        UserDefined(UserDefined),
412        /// Deprecated in favor of user_defined, which allows nullability and
413        /// variations to be specified. If user_defined_type_reference is
414        /// encountered, treat it as being non-nullable and having the default
415        /// variation.
416        #[prost(uint32, tag = "31")]
417        UserDefinedTypeReference(u32),
418        /// Reference an aliased type in `Plan.type_aliases`.
419        #[prost(message, tag = "37")]
420        Alias(TypeAliasReference),
421    }
422}
423#[derive(Clone, PartialEq, ::prost::Message)]
424pub struct TypeAlias {
425    /// A surrogate key used in the context of a single plan to reference a
426    /// specific type alias.
427    /// 0 is a valid anchor/reference, but prefer non-zero values for ergonomics.
428    #[prost(uint32, tag = "1")]
429    pub type_alias_anchor: u32,
430    /// A concrete type to be aliased.
431    ///
432    /// * All type parameters must be specified.
433    /// * Cannot directly be another alias.
434    /// * Type parameters can reference other aliased types as long as no circular dependencies are introduced.
435    /// * Nullability of aliased type is **ignored**. Nullability must be specified when the aliased type is referenced.
436    /// * Type variation may be specified in the aliased type.
437    #[prost(message, optional, tag = "2")]
438    pub r#type: ::core::option::Option<Type>,
439}
440/// A message for modeling name/type pairs.
441///
442/// Useful for representing relation schemas.
443///
444/// Notes:
445///
446/// * The names field is in depth-first order.
447///
448/// For example a schema such as:
449///
450/// a: int64
451/// b: struct<c: float32, d: string>
452///
453/// would have a `names` field that looks like:
454///
455/// \["a", "b", "c", "d"\]
456///
457/// * Only struct fields are contained in this field's elements,
458/// * Map keys should be traversed first, then values when producing/consuming
459/// * When used to represent a relation schema, the outermost struct's
460///    nullability should be NULLABILITY_REQUIRED.
461#[derive(Clone, PartialEq, ::prost::Message)]
462pub struct NamedStruct {
463    /// list of names in dfs order
464    #[prost(string, repeated, tag = "1")]
465    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
466    #[prost(message, optional, tag = "2")]
467    pub r#struct: ::core::option::Option<r#type::Struct>,
468}
469/// Common fields for all relational operators
470#[derive(Clone, PartialEq, ::prost::Message)]
471pub struct RelCommon {
472    #[prost(message, optional, tag = "3")]
473    pub hint: ::core::option::Option<rel_common::Hint>,
474    #[prost(message, optional, tag = "4")]
475    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
476    #[prost(oneof = "rel_common::EmitKind", tags = "1, 2")]
477    pub emit_kind: ::core::option::Option<rel_common::EmitKind>,
478}
479/// Nested message and enum types in `RelCommon`.
480pub mod rel_common {
481    /// Direct indicates no change on presence and ordering of fields in the output
482    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
483    pub struct Direct {}
484    /// Remap which fields are output and in which order
485    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
486    pub struct Emit {
487        #[prost(int32, repeated, tag = "1")]
488        pub output_mapping: ::prost::alloc::vec::Vec<i32>,
489    }
490    /// Changes to the operation that can influence efficiency/performance but
491    /// should not impact correctness.
492    #[derive(Clone, PartialEq, ::prost::Message)]
493    pub struct Hint {
494        #[prost(message, optional, tag = "1")]
495        pub stats: ::core::option::Option<hint::Stats>,
496        #[prost(message, optional, tag = "2")]
497        pub constraint: ::core::option::Option<hint::RuntimeConstraint>,
498        /// Name (alias) for this relation. Can be used for e.g. qualifying the relation (see e.g.
499        /// Spark's SubqueryAlias), or debugging.
500        #[prost(string, tag = "3")]
501        pub alias: ::prost::alloc::string::String,
502        /// Assigns alternative output field names for any relation.  Equivalent to the names field
503        /// in RelRoot but applies to the output of the relation this RelCommon is attached to.
504        #[prost(string, repeated, tag = "4")]
505        pub output_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
506        #[prost(message, optional, tag = "10")]
507        pub advanced_extension: ::core::option::Option<
508            super::extensions::AdvancedExtension,
509        >,
510        /// Save or load a system-specific computation for use in optimizing a remote operation.
511        /// The anchor refers to the source/destination of the computation.  The computation type
512        /// and number refer to the current relation.
513        #[prost(message, repeated, tag = "11")]
514        pub saved_computations: ::prost::alloc::vec::Vec<hint::SavedComputation>,
515        #[prost(message, repeated, tag = "12")]
516        pub loaded_computations: ::prost::alloc::vec::Vec<hint::LoadedComputation>,
517    }
518    /// Nested message and enum types in `Hint`.
519    pub mod hint {
520        /// The statistics related to a hint (physical properties of records)
521        #[derive(Clone, PartialEq, ::prost::Message)]
522        pub struct Stats {
523            #[prost(double, tag = "1")]
524            pub row_count: f64,
525            #[prost(double, tag = "2")]
526            pub record_size: f64,
527            #[prost(message, optional, tag = "10")]
528            pub advanced_extension: ::core::option::Option<
529                super::super::extensions::AdvancedExtension,
530            >,
531        }
532        /// TODO: nodes, cpu threads/%, memory, iops, etc.
533        #[derive(Clone, PartialEq, ::prost::Message)]
534        pub struct RuntimeConstraint {
535            #[prost(message, optional, tag = "10")]
536            pub advanced_extension: ::core::option::Option<
537                super::super::extensions::AdvancedExtension,
538            >,
539        }
540        #[derive(Clone, PartialEq, ::prost::Message)]
541        pub struct SavedComputation {
542            /// The value corresponds to a plan unique number for that datastructure.  Any particular
543            /// computation may be saved only once but it may be loaded multiple times.
544            #[prost(int32, tag = "1")]
545            pub computation_id: i32,
546            /// The type of this computation.  While a plan may use COMPUTATION_TYPE_UNKNOWN for all
547            /// of its types it is recommended to use a more specific type so that the optimization
548            /// is more portable.  The consumer should be able to decide if an unknown type here
549            /// matches the same unknown type at a different plan and ignore the optimization if they
550            /// are mismatched.
551            #[prost(enumeration = "ComputationType", tag = "2")]
552            pub r#type: i32,
553            #[prost(message, optional, tag = "10")]
554            pub advanced_extension: ::core::option::Option<
555                super::super::extensions::AdvancedExtension,
556            >,
557        }
558        #[derive(Clone, PartialEq, ::prost::Message)]
559        pub struct LoadedComputation {
560            /// The value corresponds to a plan unique number for that datastructure.  Any particular
561            /// computation may be saved only once but it may be loaded multiple times.
562            #[prost(int32, tag = "1")]
563            pub computation_id_reference: i32,
564            /// The type of this computation.  While a plan may use COMPUTATION_TYPE_UNKNOWN for all
565            /// of its types it is recommended to use a more specific type so that the optimization
566            /// is more portable.  The consumer should be able to decide if an unknown type here
567            /// matches the same unknown type at a different plan and ignore the optimization if they
568            /// are mismatched.
569            #[prost(enumeration = "ComputationType", tag = "2")]
570            pub r#type: i32,
571            #[prost(message, optional, tag = "10")]
572            pub advanced_extension: ::core::option::Option<
573                super::super::extensions::AdvancedExtension,
574            >,
575        }
576        #[derive(
577            Clone,
578            Copy,
579            Debug,
580            PartialEq,
581            Eq,
582            Hash,
583            PartialOrd,
584            Ord,
585            ::prost::Enumeration
586        )]
587        #[repr(i32)]
588        pub enum ComputationType {
589            Unspecified = 0,
590            Hashtable = 1,
591            BloomFilter = 2,
592            Unknown = 9999,
593        }
594        impl ComputationType {
595            /// String value of the enum field names used in the ProtoBuf definition.
596            ///
597            /// The values are not transformed in any way and thus are considered stable
598            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
599            pub fn as_str_name(&self) -> &'static str {
600                match self {
601                    Self::Unspecified => "COMPUTATION_TYPE_UNSPECIFIED",
602                    Self::Hashtable => "COMPUTATION_TYPE_HASHTABLE",
603                    Self::BloomFilter => "COMPUTATION_TYPE_BLOOM_FILTER",
604                    Self::Unknown => "COMPUTATION_TYPE_UNKNOWN",
605                }
606            }
607            /// Creates an enum from field names used in the ProtoBuf definition.
608            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
609                match value {
610                    "COMPUTATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
611                    "COMPUTATION_TYPE_HASHTABLE" => Some(Self::Hashtable),
612                    "COMPUTATION_TYPE_BLOOM_FILTER" => Some(Self::BloomFilter),
613                    "COMPUTATION_TYPE_UNKNOWN" => Some(Self::Unknown),
614                    _ => None,
615                }
616            }
617        }
618    }
619    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
620    pub enum EmitKind {
621        /// The underlying relation is output as is (no reordering or projection of columns)
622        #[prost(message, tag = "1")]
623        Direct(Direct),
624        /// Allows to control for order and inclusion of fields
625        #[prost(message, tag = "2")]
626        Emit(Emit),
627    }
628}
629/// The scan operator of base data (physical or virtual), including filtering and projection.
630#[derive(Clone, PartialEq, ::prost::Message)]
631pub struct ReadRel {
632    #[prost(message, optional, tag = "1")]
633    pub common: ::core::option::Option<RelCommon>,
634    #[prost(message, optional, tag = "2")]
635    pub base_schema: ::core::option::Option<NamedStruct>,
636    #[prost(message, optional, boxed, tag = "3")]
637    pub filter: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
638    #[prost(message, optional, boxed, tag = "11")]
639    pub best_effort_filter: ::core::option::Option<
640        ::prost::alloc::boxed::Box<Expression>,
641    >,
642    #[prost(message, optional, tag = "4")]
643    pub projection: ::core::option::Option<expression::MaskExpression>,
644    #[prost(message, optional, tag = "10")]
645    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
646    /// Definition of which type of scan operation is to be performed
647    #[prost(oneof = "read_rel::ReadType", tags = "5, 6, 7, 8, 9")]
648    pub read_type: ::core::option::Option<read_rel::ReadType>,
649}
650/// Nested message and enum types in `ReadRel`.
651pub mod read_rel {
652    /// A base table. The list of string is used to represent namespacing (e.g., mydb.mytable).
653    /// This assumes shared catalog between systems exchanging a message.
654    #[derive(Clone, PartialEq, ::prost::Message)]
655    pub struct NamedTable {
656        #[prost(string, repeated, tag = "1")]
657        pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
658        #[prost(message, optional, tag = "10")]
659        pub advanced_extension: ::core::option::Option<
660            super::extensions::AdvancedExtension,
661        >,
662    }
663    /// Read an Iceberg Table
664    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
665    pub struct IcebergTable {
666        #[prost(oneof = "iceberg_table::TableType", tags = "1")]
667        pub table_type: ::core::option::Option<iceberg_table::TableType>,
668    }
669    /// Nested message and enum types in `IcebergTable`.
670    pub mod iceberg_table {
671        /// Read an Iceberg table using a metadata file. Implicit assumption: required credentials are already known by plan consumer.
672        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
673        pub struct MetadataFileRead {
674            /// the specific uri of a metadata file (e.g. s3://mybucket/mytable/<ver>-<uuid>.metadata.json)
675            #[prost(string, tag = "1")]
676            pub metadata_uri: ::prost::alloc::string::String,
677            /// snapshot options. if none set, uses the current snapshot listed in the metadata file
678            #[prost(oneof = "metadata_file_read::Snapshot", tags = "2, 3")]
679            pub snapshot: ::core::option::Option<metadata_file_read::Snapshot>,
680        }
681        /// Nested message and enum types in `MetadataFileRead`.
682        pub mod metadata_file_read {
683            /// snapshot options. if none set, uses the current snapshot listed in the metadata file
684            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
685            pub enum Snapshot {
686                /// the snapshot id to read.
687                #[prost(string, tag = "2")]
688                SnapshotId(::prost::alloc::string::String),
689                /// the timestamp that should be used to select the snapshot (Time passed in microseconds since 1970-01-01 00:00:00.000000 in UTC)
690                #[prost(int64, tag = "3")]
691                SnapshotTimestamp(i64),
692            }
693        }
694        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
695        pub enum TableType {
696            /// future: add catalog table types (e.g. rest api, latest metadata in path, etc)
697            #[prost(message, tag = "1")]
698            Direct(MetadataFileRead),
699        }
700    }
701    /// A table composed of expressions.
702    #[derive(Clone, PartialEq, ::prost::Message)]
703    pub struct VirtualTable {
704        #[deprecated]
705        #[prost(message, repeated, tag = "1")]
706        pub values: ::prost::alloc::vec::Vec<super::expression::literal::Struct>,
707        #[prost(message, repeated, tag = "2")]
708        pub expressions: ::prost::alloc::vec::Vec<super::expression::nested::Struct>,
709    }
710    /// A stub type that can be used to extend/introduce new table types outside
711    /// the specification.
712    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
713    pub struct ExtensionTable {
714        #[prost(message, optional, tag = "1")]
715        pub detail: ::core::option::Option<::pbjson_types::Any>,
716    }
717    /// Represents a list of locally-accessible files in input of a scan operation
718    #[derive(Clone, PartialEq, ::prost::Message)]
719    pub struct LocalFiles {
720        #[prost(message, repeated, tag = "1")]
721        pub items: ::prost::alloc::vec::Vec<local_files::FileOrFiles>,
722        #[prost(message, optional, tag = "10")]
723        pub advanced_extension: ::core::option::Option<
724            super::extensions::AdvancedExtension,
725        >,
726    }
727    /// Nested message and enum types in `LocalFiles`.
728    pub mod local_files {
729        /// Many files consist of indivisible chunks (e.g. parquet row groups
730        /// or CSV rows).  If a slice partially selects an indivisible chunk
731        /// then the consumer should employ some rule to decide which slice to
732        /// include the chunk in (e.g. include it in the slice that contains
733        /// the midpoint of the chunk)
734        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
735        pub struct FileOrFiles {
736            /// The index of the partition this item belongs to
737            #[prost(uint64, tag = "6")]
738            pub partition_index: u64,
739            /// The start position in byte to read from this item
740            #[prost(uint64, tag = "7")]
741            pub start: u64,
742            /// The length in byte to read from this item
743            #[prost(uint64, tag = "8")]
744            pub length: u64,
745            /// URIs specify the location of files that are locally-accessible to the consumer.
746            /// "Locally-accessible" means the consumer can access the files directly, which may
747            /// include blob storage (e.g., S3, GCS, Azure Blob Storage) in addition to local
748            /// filesystem paths. The protocol portion of the URI determines the storage type.
749            #[prost(oneof = "file_or_files::PathType", tags = "1, 2, 3, 4")]
750            pub path_type: ::core::option::Option<file_or_files::PathType>,
751            /// The format of the files along with options for reading those files.
752            #[prost(oneof = "file_or_files::FileFormat", tags = "9, 10, 11, 12, 13, 14")]
753            pub file_format: ::core::option::Option<file_or_files::FileFormat>,
754        }
755        /// Nested message and enum types in `FileOrFiles`.
756        pub mod file_or_files {
757            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
758            pub struct ParquetReadOptions {}
759            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
760            pub struct ArrowReadOptions {}
761            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
762            pub struct OrcReadOptions {}
763            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
764            pub struct DwrfReadOptions {}
765            /// Delimiter separated files may be compressed.  The reader should
766            /// autodetect this and decompress as needed.
767            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
768            pub struct DelimiterSeparatedTextReadOptions {
769                /// The character(s) used to separate fields.  Common values are comma,
770                /// tab, and pipe.  Multiple characters are allowed.
771                #[prost(string, tag = "1")]
772                pub field_delimiter: ::prost::alloc::string::String,
773                /// The maximum number of bytes to read from a single line.  If a line
774                /// exceeds this limit the resulting behavior is undefined.
775                #[prost(uint64, tag = "2")]
776                pub max_line_size: u64,
777                /// The character(s) used to quote strings.  Common values are single
778                /// and double quotation marks.
779                #[prost(string, tag = "3")]
780                pub quote: ::prost::alloc::string::String,
781                /// The number of lines to skip at the beginning of the file.
782                #[prost(uint64, tag = "4")]
783                pub header_lines_to_skip: u64,
784                /// The character used to escape characters in strings.  Backslash is
785                /// a common value.  Note that a double quote mark can also be used as an
786                /// escape character but the external quotes should be removed first.
787                #[prost(string, tag = "5")]
788                pub escape: ::prost::alloc::string::String,
789                /// If this value is encountered (including empty string), the resulting
790                /// value is null instead.  Leave unset to disable.  If this value is
791                /// provided, the effective schema of this file is comprised entirely of
792                /// nullable strings.  If not provided, the effective schema is instead
793                /// made up of non-nullable strings.
794                #[prost(string, optional, tag = "6")]
795                pub value_treated_as_null: ::core::option::Option<
796                    ::prost::alloc::string::String,
797                >,
798            }
799            /// URIs specify the location of files that are locally-accessible to the consumer.
800            /// "Locally-accessible" means the consumer can access the files directly, which may
801            /// include blob storage (e.g., S3, GCS, Azure Blob Storage) in addition to local
802            /// filesystem paths. The protocol portion of the URI determines the storage type.
803            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
804            pub enum PathType {
805                /// A URI that can refer to either a single folder or a single file
806                #[prost(string, tag = "1")]
807                UriPath(::prost::alloc::string::String),
808                /// A URI where the path portion is a glob expression that can
809                /// identify zero or more paths.
810                /// Consumers should support the POSIX syntax.  The recursive
811                /// globstar (**) may not be supported.
812                #[prost(string, tag = "2")]
813                UriPathGlob(::prost::alloc::string::String),
814                /// A URI that refers to a single file
815                #[prost(string, tag = "3")]
816                UriFile(::prost::alloc::string::String),
817                /// A URI that refers to a single folder
818                #[prost(string, tag = "4")]
819                UriFolder(::prost::alloc::string::String),
820            }
821            /// The format of the files along with options for reading those files.
822            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
823            pub enum FileFormat {
824                #[prost(message, tag = "9")]
825                Parquet(ParquetReadOptions),
826                #[prost(message, tag = "10")]
827                Arrow(ArrowReadOptions),
828                #[prost(message, tag = "11")]
829                Orc(OrcReadOptions),
830                #[prost(message, tag = "12")]
831                Extension(::pbjson_types::Any),
832                #[prost(message, tag = "13")]
833                Dwrf(DwrfReadOptions),
834                #[prost(message, tag = "14")]
835                Text(DelimiterSeparatedTextReadOptions),
836            }
837        }
838    }
839    /// Definition of which type of scan operation is to be performed
840    #[derive(Clone, PartialEq, ::prost::Oneof)]
841    pub enum ReadType {
842        #[prost(message, tag = "5")]
843        VirtualTable(VirtualTable),
844        #[prost(message, tag = "6")]
845        LocalFiles(LocalFiles),
846        #[prost(message, tag = "7")]
847        NamedTable(NamedTable),
848        #[prost(message, tag = "8")]
849        ExtensionTable(ExtensionTable),
850        #[prost(message, tag = "9")]
851        IcebergTable(IcebergTable),
852    }
853}
854/// This operator allows to represent calculated expressions of fields (e.g., a+b). Direct/Emit are used to represent classical relational projections
855#[derive(Clone, PartialEq, ::prost::Message)]
856pub struct ProjectRel {
857    #[prost(message, optional, tag = "1")]
858    pub common: ::core::option::Option<RelCommon>,
859    #[prost(message, optional, boxed, tag = "2")]
860    pub input: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
861    #[prost(message, repeated, tag = "3")]
862    pub expressions: ::prost::alloc::vec::Vec<Expression>,
863    #[prost(message, optional, tag = "10")]
864    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
865}
866/// The binary JOIN relational operator left-join-right, including various join types, a join condition and post_join_filter expression
867#[derive(Clone, PartialEq, ::prost::Message)]
868pub struct JoinRel {
869    #[prost(message, optional, tag = "1")]
870    pub common: ::core::option::Option<RelCommon>,
871    #[prost(message, optional, boxed, tag = "2")]
872    pub left: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
873    #[prost(message, optional, boxed, tag = "3")]
874    pub right: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
875    #[prost(message, optional, boxed, tag = "4")]
876    pub expression: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
877    #[prost(message, optional, boxed, tag = "5")]
878    pub post_join_filter: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
879    #[prost(enumeration = "join_rel::JoinType", tag = "6")]
880    pub r#type: i32,
881    #[prost(message, optional, tag = "10")]
882    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
883}
884/// Nested message and enum types in `JoinRel`.
885pub mod join_rel {
886    #[derive(
887        Clone,
888        Copy,
889        Debug,
890        PartialEq,
891        Eq,
892        Hash,
893        PartialOrd,
894        Ord,
895        ::prost::Enumeration
896    )]
897    #[repr(i32)]
898    pub enum JoinType {
899        Unspecified = 0,
900        Inner = 1,
901        Outer = 2,
902        Left = 3,
903        Right = 4,
904        LeftSemi = 5,
905        LeftAnti = 6,
906        LeftSingle = 7,
907        RightSemi = 8,
908        RightAnti = 9,
909        RightSingle = 10,
910        LeftMark = 11,
911        RightMark = 12,
912    }
913    impl JoinType {
914        /// String value of the enum field names used in the ProtoBuf definition.
915        ///
916        /// The values are not transformed in any way and thus are considered stable
917        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
918        pub fn as_str_name(&self) -> &'static str {
919            match self {
920                Self::Unspecified => "JOIN_TYPE_UNSPECIFIED",
921                Self::Inner => "JOIN_TYPE_INNER",
922                Self::Outer => "JOIN_TYPE_OUTER",
923                Self::Left => "JOIN_TYPE_LEFT",
924                Self::Right => "JOIN_TYPE_RIGHT",
925                Self::LeftSemi => "JOIN_TYPE_LEFT_SEMI",
926                Self::LeftAnti => "JOIN_TYPE_LEFT_ANTI",
927                Self::LeftSingle => "JOIN_TYPE_LEFT_SINGLE",
928                Self::RightSemi => "JOIN_TYPE_RIGHT_SEMI",
929                Self::RightAnti => "JOIN_TYPE_RIGHT_ANTI",
930                Self::RightSingle => "JOIN_TYPE_RIGHT_SINGLE",
931                Self::LeftMark => "JOIN_TYPE_LEFT_MARK",
932                Self::RightMark => "JOIN_TYPE_RIGHT_MARK",
933            }
934        }
935        /// Creates an enum from field names used in the ProtoBuf definition.
936        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
937            match value {
938                "JOIN_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
939                "JOIN_TYPE_INNER" => Some(Self::Inner),
940                "JOIN_TYPE_OUTER" => Some(Self::Outer),
941                "JOIN_TYPE_LEFT" => Some(Self::Left),
942                "JOIN_TYPE_RIGHT" => Some(Self::Right),
943                "JOIN_TYPE_LEFT_SEMI" => Some(Self::LeftSemi),
944                "JOIN_TYPE_LEFT_ANTI" => Some(Self::LeftAnti),
945                "JOIN_TYPE_LEFT_SINGLE" => Some(Self::LeftSingle),
946                "JOIN_TYPE_RIGHT_SEMI" => Some(Self::RightSemi),
947                "JOIN_TYPE_RIGHT_ANTI" => Some(Self::RightAnti),
948                "JOIN_TYPE_RIGHT_SINGLE" => Some(Self::RightSingle),
949                "JOIN_TYPE_LEFT_MARK" => Some(Self::LeftMark),
950                "JOIN_TYPE_RIGHT_MARK" => Some(Self::RightMark),
951                _ => None,
952            }
953        }
954    }
955}
956/// Cartesian product relational operator of two tables (left and right)
957#[derive(Clone, PartialEq, ::prost::Message)]
958pub struct CrossRel {
959    #[prost(message, optional, tag = "1")]
960    pub common: ::core::option::Option<RelCommon>,
961    #[prost(message, optional, boxed, tag = "2")]
962    pub left: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
963    #[prost(message, optional, boxed, tag = "3")]
964    pub right: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
965    #[prost(message, optional, tag = "10")]
966    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
967}
968/// The relational operator representing LIMIT/OFFSET or TOP type semantics.
969#[derive(Clone, PartialEq, ::prost::Message)]
970pub struct FetchRel {
971    #[prost(message, optional, tag = "1")]
972    pub common: ::core::option::Option<RelCommon>,
973    #[prost(message, optional, boxed, tag = "2")]
974    pub input: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
975    #[prost(message, optional, tag = "10")]
976    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
977    /// Note: A oneof field is inherently optional, whereas individual fields
978    /// within a oneof cannot be marked as optional. The unset state of offset
979    /// should therefore be checked at the oneof level. Unset is treated as 0.
980    #[prost(oneof = "fetch_rel::OffsetMode", tags = "3, 5")]
981    pub offset_mode: ::core::option::Option<fetch_rel::OffsetMode>,
982    /// Note: A oneof field is inherently optional, whereas individual fields
983    /// within a oneof cannot be marked as optional. The unset state of count
984    /// should therefore be checked at the oneof level. Unset is treated as ALL.
985    #[prost(oneof = "fetch_rel::CountMode", tags = "4, 6")]
986    pub count_mode: ::core::option::Option<fetch_rel::CountMode>,
987}
988/// Nested message and enum types in `FetchRel`.
989pub mod fetch_rel {
990    /// Note: A oneof field is inherently optional, whereas individual fields
991    /// within a oneof cannot be marked as optional. The unset state of offset
992    /// should therefore be checked at the oneof level. Unset is treated as 0.
993    #[derive(Clone, PartialEq, ::prost::Oneof)]
994    pub enum OffsetMode {
995        /// the offset expressed in number of records
996        /// Deprecated: use `offset_expr` instead
997        #[prost(int64, tag = "3")]
998        Offset(i64),
999        /// Expression evaluated into a non-negative integer specifying the number
1000        /// of records to skip. An expression evaluating to null is treated as 0.
1001        /// Evaluating to a negative integer should result in an error.
1002        /// Recommended type for offset is int64.
1003        #[prost(message, tag = "5")]
1004        OffsetExpr(::prost::alloc::boxed::Box<super::Expression>),
1005    }
1006    /// Note: A oneof field is inherently optional, whereas individual fields
1007    /// within a oneof cannot be marked as optional. The unset state of count
1008    /// should therefore be checked at the oneof level. Unset is treated as ALL.
1009    #[derive(Clone, PartialEq, ::prost::Oneof)]
1010    pub enum CountMode {
1011        /// the amount of records to return
1012        /// use -1 to signal that ALL records should be returned
1013        /// Deprecated: use `count_expr` instead
1014        #[prost(int64, tag = "4")]
1015        Count(i64),
1016        /// Expression evaluated into a non-negative integer specifying the number
1017        /// of records to return. An expression evaluating to null signals that ALL
1018        /// records should be returned.
1019        /// Evaluating to a negative integer should result in an error.
1020        /// Recommended type for count is int64.
1021        #[prost(message, tag = "6")]
1022        CountExpr(::prost::alloc::boxed::Box<super::Expression>),
1023    }
1024}
1025/// The relational operator representing a GROUP BY Aggregate
1026#[derive(Clone, PartialEq, ::prost::Message)]
1027pub struct AggregateRel {
1028    #[prost(message, optional, tag = "1")]
1029    pub common: ::core::option::Option<RelCommon>,
1030    /// Input of the aggregation
1031    #[prost(message, optional, boxed, tag = "2")]
1032    pub input: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
1033    /// A list of zero or more grouping sets that the aggregation measures should
1034    /// be calculated for. There must be at least one grouping set if there are no
1035    /// measures (but it can be the empty grouping set).
1036    #[prost(message, repeated, tag = "3")]
1037    pub groupings: ::prost::alloc::vec::Vec<aggregate_rel::Grouping>,
1038    /// A list of one or more aggregate expressions along with an optional filter.
1039    /// Required if there are no groupings.
1040    #[prost(message, repeated, tag = "4")]
1041    pub measures: ::prost::alloc::vec::Vec<aggregate_rel::Measure>,
1042    /// A list of zero or more grouping expressions that grouping sets (i.e.,
1043    /// `Grouping` messages in the `groupings` field) can reference. Each
1044    /// expression in this list must be referred to by at least one
1045    /// `Grouping.expression_references`.
1046    #[prost(message, repeated, tag = "5")]
1047    pub grouping_expressions: ::prost::alloc::vec::Vec<Expression>,
1048    #[prost(message, optional, tag = "10")]
1049    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1050}
1051/// Nested message and enum types in `AggregateRel`.
1052pub mod aggregate_rel {
1053    #[derive(Clone, PartialEq, ::prost::Message)]
1054    pub struct Grouping {
1055        /// Deprecated in favor of `expression_references` below.
1056        #[deprecated]
1057        #[prost(message, repeated, tag = "1")]
1058        pub grouping_expressions: ::prost::alloc::vec::Vec<super::Expression>,
1059        /// A list of zero or more references to grouping expressions, i.e., indices
1060        /// into the `grouping_expression` list.
1061        #[prost(uint32, repeated, tag = "2")]
1062        pub expression_references: ::prost::alloc::vec::Vec<u32>,
1063    }
1064    #[derive(Clone, PartialEq, ::prost::Message)]
1065    pub struct Measure {
1066        #[prost(message, optional, tag = "1")]
1067        pub measure: ::core::option::Option<super::AggregateFunction>,
1068        /// An optional boolean expression that acts to filter which records are
1069        /// included in the measure. True means include this record for calculation
1070        /// within the measure.
1071        /// Helps to support SUM(<c>) FILTER(WHERE...) syntax without masking opportunities for optimization
1072        #[prost(message, optional, tag = "2")]
1073        pub filter: ::core::option::Option<super::Expression>,
1074    }
1075}
1076/// ConsistentPartitionWindowRel provides the ability to perform calculations across sets of rows
1077/// that are related to the current query row. It can be used to execute window functions where
1078/// all the windows share the same partitioning and ordering.
1079#[derive(Clone, PartialEq, ::prost::Message)]
1080pub struct ConsistentPartitionWindowRel {
1081    #[prost(message, optional, tag = "1")]
1082    pub common: ::core::option::Option<RelCommon>,
1083    #[prost(message, optional, boxed, tag = "2")]
1084    pub input: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
1085    #[prost(message, repeated, tag = "3")]
1086    pub window_functions: ::prost::alloc::vec::Vec<
1087        consistent_partition_window_rel::WindowRelFunction,
1088    >,
1089    #[prost(message, repeated, tag = "4")]
1090    pub partition_expressions: ::prost::alloc::vec::Vec<Expression>,
1091    #[prost(message, repeated, tag = "5")]
1092    pub sorts: ::prost::alloc::vec::Vec<SortField>,
1093    #[prost(message, optional, tag = "10")]
1094    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1095}
1096/// Nested message and enum types in `ConsistentPartitionWindowRel`.
1097pub mod consistent_partition_window_rel {
1098    /// This message mirrors the `WindowFunction` message but removes the fields defining the partition,
1099    /// sorts, and bounds, since those must be consistent across the various functions in this rel.  Refer
1100    /// to the `WindowFunction` message for a description of these fields.
1101    #[derive(Clone, PartialEq, ::prost::Message)]
1102    pub struct WindowRelFunction {
1103        /// References a function_anchor defined in this plan.
1104        #[prost(uint32, tag = "1")]
1105        pub function_reference: u32,
1106        #[prost(message, repeated, tag = "9")]
1107        pub arguments: ::prost::alloc::vec::Vec<super::FunctionArgument>,
1108        #[prost(message, repeated, tag = "11")]
1109        pub options: ::prost::alloc::vec::Vec<super::FunctionOption>,
1110        #[prost(message, optional, tag = "7")]
1111        pub output_type: ::core::option::Option<super::Type>,
1112        #[prost(enumeration = "super::AggregationPhase", tag = "6")]
1113        pub phase: i32,
1114        #[prost(
1115            enumeration = "super::aggregate_function::AggregationInvocation",
1116            tag = "10"
1117        )]
1118        pub invocation: i32,
1119        #[prost(message, optional, tag = "5")]
1120        pub lower_bound: ::core::option::Option<
1121            super::expression::window_function::Bound,
1122        >,
1123        #[prost(message, optional, tag = "4")]
1124        pub upper_bound: ::core::option::Option<
1125            super::expression::window_function::Bound,
1126        >,
1127        #[prost(
1128            enumeration = "super::expression::window_function::BoundsType",
1129            tag = "12"
1130        )]
1131        pub bounds_type: i32,
1132    }
1133}
1134/// The ORDERY BY (or sorting) relational operator. Beside describing a base relation, it includes a list of fields to sort on
1135#[derive(Clone, PartialEq, ::prost::Message)]
1136pub struct SortRel {
1137    #[prost(message, optional, tag = "1")]
1138    pub common: ::core::option::Option<RelCommon>,
1139    #[prost(message, optional, boxed, tag = "2")]
1140    pub input: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
1141    #[prost(message, repeated, tag = "3")]
1142    pub sorts: ::prost::alloc::vec::Vec<SortField>,
1143    #[prost(message, optional, tag = "10")]
1144    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1145}
1146/// The relational operator capturing simple FILTERs (as in the WHERE clause of SQL)
1147#[derive(Clone, PartialEq, ::prost::Message)]
1148pub struct FilterRel {
1149    #[prost(message, optional, tag = "1")]
1150    pub common: ::core::option::Option<RelCommon>,
1151    #[prost(message, optional, boxed, tag = "2")]
1152    pub input: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
1153    #[prost(message, optional, boxed, tag = "3")]
1154    pub condition: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
1155    #[prost(message, optional, tag = "10")]
1156    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1157}
1158/// The relational set operators (intersection/union/etc..)
1159#[derive(Clone, PartialEq, ::prost::Message)]
1160pub struct SetRel {
1161    #[prost(message, optional, tag = "1")]
1162    pub common: ::core::option::Option<RelCommon>,
1163    /// The first input is the primary input, the remaining are secondary
1164    /// inputs.  There must be at least two inputs.
1165    #[prost(message, repeated, tag = "2")]
1166    pub inputs: ::prost::alloc::vec::Vec<Rel>,
1167    #[prost(enumeration = "set_rel::SetOp", tag = "3")]
1168    pub op: i32,
1169    #[prost(message, optional, tag = "10")]
1170    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1171}
1172/// Nested message and enum types in `SetRel`.
1173pub mod set_rel {
1174    #[derive(
1175        Clone,
1176        Copy,
1177        Debug,
1178        PartialEq,
1179        Eq,
1180        Hash,
1181        PartialOrd,
1182        Ord,
1183        ::prost::Enumeration
1184    )]
1185    #[repr(i32)]
1186    pub enum SetOp {
1187        Unspecified = 0,
1188        MinusPrimary = 1,
1189        MinusPrimaryAll = 7,
1190        MinusMultiset = 2,
1191        IntersectionPrimary = 3,
1192        IntersectionMultiset = 4,
1193        IntersectionMultisetAll = 8,
1194        UnionDistinct = 5,
1195        UnionAll = 6,
1196    }
1197    impl SetOp {
1198        /// String value of the enum field names used in the ProtoBuf definition.
1199        ///
1200        /// The values are not transformed in any way and thus are considered stable
1201        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1202        pub fn as_str_name(&self) -> &'static str {
1203            match self {
1204                Self::Unspecified => "SET_OP_UNSPECIFIED",
1205                Self::MinusPrimary => "SET_OP_MINUS_PRIMARY",
1206                Self::MinusPrimaryAll => "SET_OP_MINUS_PRIMARY_ALL",
1207                Self::MinusMultiset => "SET_OP_MINUS_MULTISET",
1208                Self::IntersectionPrimary => "SET_OP_INTERSECTION_PRIMARY",
1209                Self::IntersectionMultiset => "SET_OP_INTERSECTION_MULTISET",
1210                Self::IntersectionMultisetAll => "SET_OP_INTERSECTION_MULTISET_ALL",
1211                Self::UnionDistinct => "SET_OP_UNION_DISTINCT",
1212                Self::UnionAll => "SET_OP_UNION_ALL",
1213            }
1214        }
1215        /// Creates an enum from field names used in the ProtoBuf definition.
1216        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1217            match value {
1218                "SET_OP_UNSPECIFIED" => Some(Self::Unspecified),
1219                "SET_OP_MINUS_PRIMARY" => Some(Self::MinusPrimary),
1220                "SET_OP_MINUS_PRIMARY_ALL" => Some(Self::MinusPrimaryAll),
1221                "SET_OP_MINUS_MULTISET" => Some(Self::MinusMultiset),
1222                "SET_OP_INTERSECTION_PRIMARY" => Some(Self::IntersectionPrimary),
1223                "SET_OP_INTERSECTION_MULTISET" => Some(Self::IntersectionMultiset),
1224                "SET_OP_INTERSECTION_MULTISET_ALL" => Some(Self::IntersectionMultisetAll),
1225                "SET_OP_UNION_DISTINCT" => Some(Self::UnionDistinct),
1226                "SET_OP_UNION_ALL" => Some(Self::UnionAll),
1227                _ => None,
1228            }
1229        }
1230    }
1231}
1232/// Stub to support extension with a single input
1233#[derive(Clone, PartialEq, ::prost::Message)]
1234pub struct ExtensionSingleRel {
1235    #[prost(message, optional, tag = "1")]
1236    pub common: ::core::option::Option<RelCommon>,
1237    #[prost(message, optional, boxed, tag = "2")]
1238    pub input: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
1239    #[prost(message, optional, tag = "3")]
1240    pub detail: ::core::option::Option<::pbjson_types::Any>,
1241}
1242/// Stub to support extension with a zero inputs
1243#[derive(Clone, PartialEq, ::prost::Message)]
1244pub struct ExtensionLeafRel {
1245    #[prost(message, optional, tag = "1")]
1246    pub common: ::core::option::Option<RelCommon>,
1247    #[prost(message, optional, tag = "2")]
1248    pub detail: ::core::option::Option<::pbjson_types::Any>,
1249}
1250/// Stub to support extension with multiple inputs
1251#[derive(Clone, PartialEq, ::prost::Message)]
1252pub struct ExtensionMultiRel {
1253    #[prost(message, optional, tag = "1")]
1254    pub common: ::core::option::Option<RelCommon>,
1255    #[prost(message, repeated, tag = "2")]
1256    pub inputs: ::prost::alloc::vec::Vec<Rel>,
1257    #[prost(message, optional, tag = "3")]
1258    pub detail: ::core::option::Option<::pbjson_types::Any>,
1259}
1260/// A redistribution operation
1261#[derive(Clone, PartialEq, ::prost::Message)]
1262pub struct ExchangeRel {
1263    #[prost(message, optional, tag = "1")]
1264    pub common: ::core::option::Option<RelCommon>,
1265    #[prost(message, optional, boxed, tag = "2")]
1266    pub input: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
1267    #[prost(int32, tag = "3")]
1268    pub partition_count: i32,
1269    #[prost(message, repeated, tag = "4")]
1270    pub targets: ::prost::alloc::vec::Vec<exchange_rel::ExchangeTarget>,
1271    #[prost(message, optional, tag = "10")]
1272    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1273    /// the type of exchange used
1274    #[prost(oneof = "exchange_rel::ExchangeKind", tags = "5, 6, 7, 8, 9")]
1275    pub exchange_kind: ::core::option::Option<exchange_rel::ExchangeKind>,
1276}
1277/// Nested message and enum types in `ExchangeRel`.
1278pub mod exchange_rel {
1279    #[derive(Clone, PartialEq, ::prost::Message)]
1280    pub struct ScatterFields {
1281        #[prost(message, repeated, tag = "1")]
1282        pub fields: ::prost::alloc::vec::Vec<super::expression::FieldReference>,
1283    }
1284    /// Returns a single bucket number per record.
1285    #[derive(Clone, PartialEq, ::prost::Message)]
1286    pub struct SingleBucketExpression {
1287        #[prost(message, optional, boxed, tag = "1")]
1288        pub expression: ::core::option::Option<
1289            ::prost::alloc::boxed::Box<super::Expression>,
1290        >,
1291    }
1292    /// Returns zero or more bucket numbers per record
1293    #[derive(Clone, PartialEq, ::prost::Message)]
1294    pub struct MultiBucketExpression {
1295        #[prost(message, optional, boxed, tag = "1")]
1296        pub expression: ::core::option::Option<
1297            ::prost::alloc::boxed::Box<super::Expression>,
1298        >,
1299        #[prost(bool, tag = "2")]
1300        pub constrained_to_count: bool,
1301    }
1302    /// Send all data to every target.
1303    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1304    pub struct Broadcast {}
1305    /// Route approximately
1306    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1307    pub struct RoundRobin {
1308        /// whether the round robin behavior is required to exact (per record) or
1309        /// approximate. Defaults to approximate.
1310        #[prost(bool, tag = "1")]
1311        pub exact: bool,
1312    }
1313    /// The message to describe partition targets of an exchange
1314    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1315    pub struct ExchangeTarget {
1316        /// Describes the partition id(s) to send. If this is empty, all data is sent
1317        /// to this target.
1318        #[prost(int32, repeated, tag = "1")]
1319        pub partition_id: ::prost::alloc::vec::Vec<i32>,
1320        #[prost(oneof = "exchange_target::TargetType", tags = "2, 3")]
1321        pub target_type: ::core::option::Option<exchange_target::TargetType>,
1322    }
1323    /// Nested message and enum types in `ExchangeTarget`.
1324    pub mod exchange_target {
1325        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1326        pub enum TargetType {
1327            #[prost(string, tag = "2")]
1328            Uri(::prost::alloc::string::String),
1329            #[prost(message, tag = "3")]
1330            Extended(::pbjson_types::Any),
1331        }
1332    }
1333    /// the type of exchange used
1334    #[derive(Clone, PartialEq, ::prost::Oneof)]
1335    pub enum ExchangeKind {
1336        #[prost(message, tag = "5")]
1337        ScatterByFields(ScatterFields),
1338        #[prost(message, tag = "6")]
1339        SingleTarget(::prost::alloc::boxed::Box<SingleBucketExpression>),
1340        #[prost(message, tag = "7")]
1341        MultiTarget(::prost::alloc::boxed::Box<MultiBucketExpression>),
1342        #[prost(message, tag = "8")]
1343        RoundRobin(RoundRobin),
1344        #[prost(message, tag = "9")]
1345        Broadcast(Broadcast),
1346    }
1347}
1348/// Duplicates records by emitting one or more rows per input row.  The number of rows emitted per
1349/// input row is the same for all input rows.
1350///
1351/// In addition to a field being emitted per input field an extra int64 field is emitted which
1352/// contains a zero-indexed ordinal corresponding to the duplicate definition.
1353#[derive(Clone, PartialEq, ::prost::Message)]
1354pub struct ExpandRel {
1355    #[prost(message, optional, tag = "1")]
1356    pub common: ::core::option::Option<RelCommon>,
1357    #[prost(message, optional, boxed, tag = "2")]
1358    pub input: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
1359    /// There should be one definition here for each input field.  Any fields beyond the provided
1360    /// definitions will be emitted as is (as if a consistent_field record with an identity
1361    /// expression was provided).
1362    #[prost(message, repeated, tag = "4")]
1363    pub fields: ::prost::alloc::vec::Vec<expand_rel::ExpandField>,
1364}
1365/// Nested message and enum types in `ExpandRel`.
1366pub mod expand_rel {
1367    #[derive(Clone, PartialEq, ::prost::Message)]
1368    pub struct ExpandField {
1369        #[prost(oneof = "expand_field::FieldType", tags = "2, 3")]
1370        pub field_type: ::core::option::Option<expand_field::FieldType>,
1371    }
1372    /// Nested message and enum types in `ExpandField`.
1373    pub mod expand_field {
1374        #[derive(Clone, PartialEq, ::prost::Oneof)]
1375        pub enum FieldType {
1376            /// Field that switches output based on which duplicate is being output.  Every
1377            /// switching_field should contain the same number of duplicates (so that the output rows
1378            /// are of consistent size and type).  If there are not enough switching field definitions
1379            /// to match the other field definitions NULL will be returned to fill the extras.
1380            #[prost(message, tag = "2")]
1381            SwitchingField(super::SwitchingField),
1382            /// Field that outputs the same value no matter which duplicate is being output.  Equivalent
1383            /// to a switching_field that lists the same expression multiple times.
1384            #[prost(message, tag = "3")]
1385            ConsistentField(super::super::Expression),
1386        }
1387    }
1388    #[derive(Clone, PartialEq, ::prost::Message)]
1389    pub struct SwitchingField {
1390        /// All duplicates must return the same type class but may differ in nullability.  The effective
1391        /// type of the output field will be nullable if any of the duplicate expressions are nullable.
1392        #[prost(message, repeated, tag = "1")]
1393        pub duplicates: ::prost::alloc::vec::Vec<super::Expression>,
1394    }
1395}
1396/// A relation with output field names.
1397///
1398/// This is for use at the root of a `Rel` tree.
1399#[derive(Clone, PartialEq, ::prost::Message)]
1400pub struct RelRoot {
1401    /// A relation
1402    #[prost(message, optional, tag = "1")]
1403    pub input: ::core::option::Option<Rel>,
1404    /// Field names in depth-first order
1405    #[prost(string, repeated, tag = "2")]
1406    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1407}
1408/// A relation (used internally in a plan)
1409#[derive(Clone, PartialEq, ::prost::Message)]
1410pub struct Rel {
1411    #[prost(
1412        oneof = "rel::RelType",
1413        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 21, 19, 20, 22, 13, 14, 18, 17, 15, 16"
1414    )]
1415    pub rel_type: ::core::option::Option<rel::RelType>,
1416}
1417/// Nested message and enum types in `Rel`.
1418pub mod rel {
1419    #[derive(Clone, PartialEq, ::prost::Oneof)]
1420    pub enum RelType {
1421        #[prost(message, tag = "1")]
1422        Read(::prost::alloc::boxed::Box<super::ReadRel>),
1423        #[prost(message, tag = "2")]
1424        Filter(::prost::alloc::boxed::Box<super::FilterRel>),
1425        #[prost(message, tag = "3")]
1426        Fetch(::prost::alloc::boxed::Box<super::FetchRel>),
1427        #[prost(message, tag = "4")]
1428        Aggregate(::prost::alloc::boxed::Box<super::AggregateRel>),
1429        #[prost(message, tag = "5")]
1430        Sort(::prost::alloc::boxed::Box<super::SortRel>),
1431        #[prost(message, tag = "6")]
1432        Join(::prost::alloc::boxed::Box<super::JoinRel>),
1433        #[prost(message, tag = "7")]
1434        Project(::prost::alloc::boxed::Box<super::ProjectRel>),
1435        #[prost(message, tag = "8")]
1436        Set(super::SetRel),
1437        #[prost(message, tag = "9")]
1438        ExtensionSingle(::prost::alloc::boxed::Box<super::ExtensionSingleRel>),
1439        #[prost(message, tag = "10")]
1440        ExtensionMulti(super::ExtensionMultiRel),
1441        #[prost(message, tag = "11")]
1442        ExtensionLeaf(super::ExtensionLeafRel),
1443        #[prost(message, tag = "12")]
1444        Cross(::prost::alloc::boxed::Box<super::CrossRel>),
1445        #[prost(message, tag = "21")]
1446        Reference(super::ReferenceRel),
1447        #[prost(message, tag = "19")]
1448        Write(::prost::alloc::boxed::Box<super::WriteRel>),
1449        #[prost(message, tag = "20")]
1450        Ddl(::prost::alloc::boxed::Box<super::DdlRel>),
1451        #[prost(message, tag = "22")]
1452        Update(::prost::alloc::boxed::Box<super::UpdateRel>),
1453        /// Physical relations
1454        #[prost(message, tag = "13")]
1455        HashJoin(::prost::alloc::boxed::Box<super::HashJoinRel>),
1456        #[prost(message, tag = "14")]
1457        MergeJoin(::prost::alloc::boxed::Box<super::MergeJoinRel>),
1458        #[prost(message, tag = "18")]
1459        NestedLoopJoin(::prost::alloc::boxed::Box<super::NestedLoopJoinRel>),
1460        #[prost(message, tag = "17")]
1461        Window(::prost::alloc::boxed::Box<super::ConsistentPartitionWindowRel>),
1462        #[prost(message, tag = "15")]
1463        Exchange(::prost::alloc::boxed::Box<super::ExchangeRel>),
1464        #[prost(message, tag = "16")]
1465        Expand(::prost::alloc::boxed::Box<super::ExpandRel>),
1466    }
1467}
1468/// A base object for writing (e.g., a table or a view).
1469#[derive(Clone, PartialEq, ::prost::Message)]
1470pub struct NamedObjectWrite {
1471    /// The list of string is used to represent namespacing (e.g., mydb.mytable).
1472    /// This assumes shared catalog between systems exchanging a message.
1473    #[prost(string, repeated, tag = "1")]
1474    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1475    #[prost(message, optional, tag = "10")]
1476    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1477}
1478/// A stub type that can be used to extend/introduce new table types outside
1479/// the specification.
1480#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1481pub struct ExtensionObject {
1482    #[prost(message, optional, tag = "1")]
1483    pub detail: ::core::option::Option<::pbjson_types::Any>,
1484}
1485#[derive(Clone, PartialEq, ::prost::Message)]
1486pub struct DdlRel {
1487    /// The columns that will be modified (representing after-image of a schema change)
1488    #[prost(message, optional, tag = "3")]
1489    pub table_schema: ::core::option::Option<NamedStruct>,
1490    /// The default values for the columns (representing after-image of a schema change)
1491    /// E.g., in case of an ALTER TABLE that changes some of the column default values, we expect
1492    /// the table_defaults Struct to report a full list of default values reflecting the result of applying
1493    /// the ALTER TABLE operator successfully
1494    #[prost(message, optional, tag = "4")]
1495    pub table_defaults: ::core::option::Option<expression::literal::Struct>,
1496    /// Which type of object we operate on
1497    #[prost(enumeration = "ddl_rel::DdlObject", tag = "5")]
1498    pub object: i32,
1499    /// The type of operation to perform
1500    #[prost(enumeration = "ddl_rel::DdlOp", tag = "6")]
1501    pub op: i32,
1502    /// The body of the CREATE VIEW
1503    #[prost(message, optional, boxed, tag = "7")]
1504    pub view_definition: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
1505    #[prost(message, optional, tag = "8")]
1506    pub common: ::core::option::Option<RelCommon>,
1507    #[prost(message, optional, tag = "9")]
1508    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1509    /// Definition of which type of object we are operating on
1510    #[prost(oneof = "ddl_rel::WriteType", tags = "1, 2")]
1511    pub write_type: ::core::option::Option<ddl_rel::WriteType>,
1512}
1513/// Nested message and enum types in `DdlRel`.
1514pub mod ddl_rel {
1515    #[derive(
1516        Clone,
1517        Copy,
1518        Debug,
1519        PartialEq,
1520        Eq,
1521        Hash,
1522        PartialOrd,
1523        Ord,
1524        ::prost::Enumeration
1525    )]
1526    #[repr(i32)]
1527    pub enum DdlObject {
1528        Unspecified = 0,
1529        /// A Table object in the system
1530        Table = 1,
1531        /// A View object in the system
1532        View = 2,
1533    }
1534    impl DdlObject {
1535        /// String value of the enum field names used in the ProtoBuf definition.
1536        ///
1537        /// The values are not transformed in any way and thus are considered stable
1538        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1539        pub fn as_str_name(&self) -> &'static str {
1540            match self {
1541                Self::Unspecified => "DDL_OBJECT_UNSPECIFIED",
1542                Self::Table => "DDL_OBJECT_TABLE",
1543                Self::View => "DDL_OBJECT_VIEW",
1544            }
1545        }
1546        /// Creates an enum from field names used in the ProtoBuf definition.
1547        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1548            match value {
1549                "DDL_OBJECT_UNSPECIFIED" => Some(Self::Unspecified),
1550                "DDL_OBJECT_TABLE" => Some(Self::Table),
1551                "DDL_OBJECT_VIEW" => Some(Self::View),
1552                _ => None,
1553            }
1554        }
1555    }
1556    #[derive(
1557        Clone,
1558        Copy,
1559        Debug,
1560        PartialEq,
1561        Eq,
1562        Hash,
1563        PartialOrd,
1564        Ord,
1565        ::prost::Enumeration
1566    )]
1567    #[repr(i32)]
1568    pub enum DdlOp {
1569        Unspecified = 0,
1570        /// A create operation (for any object)
1571        Create = 1,
1572        /// A create operation if the object does not exist, or replaces it (equivalent to a DROP + CREATE) if the object already exists
1573        CreateOrReplace = 2,
1574        /// An operation that modifies the schema (e.g., column names, types, default values) for the target object
1575        Alter = 3,
1576        /// An operation that removes an object from the system
1577        Drop = 4,
1578        /// An operation that removes an object from the system (without throwing an exception if the object did not exist)
1579        DropIfExist = 5,
1580    }
1581    impl DdlOp {
1582        /// String value of the enum field names used in the ProtoBuf definition.
1583        ///
1584        /// The values are not transformed in any way and thus are considered stable
1585        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1586        pub fn as_str_name(&self) -> &'static str {
1587            match self {
1588                Self::Unspecified => "DDL_OP_UNSPECIFIED",
1589                Self::Create => "DDL_OP_CREATE",
1590                Self::CreateOrReplace => "DDL_OP_CREATE_OR_REPLACE",
1591                Self::Alter => "DDL_OP_ALTER",
1592                Self::Drop => "DDL_OP_DROP",
1593                Self::DropIfExist => "DDL_OP_DROP_IF_EXIST",
1594            }
1595        }
1596        /// Creates an enum from field names used in the ProtoBuf definition.
1597        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1598            match value {
1599                "DDL_OP_UNSPECIFIED" => Some(Self::Unspecified),
1600                "DDL_OP_CREATE" => Some(Self::Create),
1601                "DDL_OP_CREATE_OR_REPLACE" => Some(Self::CreateOrReplace),
1602                "DDL_OP_ALTER" => Some(Self::Alter),
1603                "DDL_OP_DROP" => Some(Self::Drop),
1604                "DDL_OP_DROP_IF_EXIST" => Some(Self::DropIfExist),
1605                _ => None,
1606            }
1607        }
1608    }
1609    /// Definition of which type of object we are operating on
1610    #[derive(Clone, PartialEq, ::prost::Oneof)]
1611    pub enum WriteType {
1612        #[prost(message, tag = "1")]
1613        NamedObject(super::NamedObjectWrite),
1614        #[prost(message, tag = "2")]
1615        ExtensionObject(super::ExtensionObject),
1616    }
1617}
1618/// The operator that modifies the content of a database (operates on 1 table at a time, but record-selection/source can be
1619/// based on joining of multiple tables).
1620#[derive(Clone, PartialEq, ::prost::Message)]
1621pub struct WriteRel {
1622    /// The schema of the table (must align with Rel input (e.g., number of leaf fields must match))
1623    #[prost(message, optional, tag = "3")]
1624    pub table_schema: ::core::option::Option<NamedStruct>,
1625    /// The type of operation to perform
1626    #[prost(enumeration = "write_rel::WriteOp", tag = "4")]
1627    pub op: i32,
1628    /// The relation that determines the records to add/remove/modify
1629    /// the schema must match with table_schema. Default values must be explicitly stated
1630    /// in a ProjectRel at the top of the input. The match must also
1631    /// occur in case of DELETE to ensure multi-engine plans are unequivocal.
1632    #[prost(message, optional, boxed, tag = "5")]
1633    pub input: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
1634    /// Used with CTAS to determine what to do if the table already exists
1635    #[prost(enumeration = "write_rel::CreateMode", tag = "8")]
1636    pub create_mode: i32,
1637    /// Output mode determines what is the output of executing this rel
1638    #[prost(enumeration = "write_rel::OutputMode", tag = "6")]
1639    pub output: i32,
1640    #[prost(message, optional, tag = "7")]
1641    pub common: ::core::option::Option<RelCommon>,
1642    #[prost(message, optional, tag = "9")]
1643    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1644    /// Definition of which TABLE we are operating on
1645    #[prost(oneof = "write_rel::WriteType", tags = "1, 2")]
1646    pub write_type: ::core::option::Option<write_rel::WriteType>,
1647}
1648/// Nested message and enum types in `WriteRel`.
1649pub mod write_rel {
1650    #[derive(
1651        Clone,
1652        Copy,
1653        Debug,
1654        PartialEq,
1655        Eq,
1656        Hash,
1657        PartialOrd,
1658        Ord,
1659        ::prost::Enumeration
1660    )]
1661    #[repr(i32)]
1662    pub enum WriteOp {
1663        Unspecified = 0,
1664        /// The insert of new records in a table
1665        Insert = 1,
1666        /// The removal of records from a table
1667        Delete = 2,
1668        /// The modification of existing records within a table
1669        Update = 3,
1670        /// The Creation of a new table, and the insert of new records in the table
1671        Ctas = 4,
1672    }
1673    impl WriteOp {
1674        /// String value of the enum field names used in the ProtoBuf definition.
1675        ///
1676        /// The values are not transformed in any way and thus are considered stable
1677        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1678        pub fn as_str_name(&self) -> &'static str {
1679            match self {
1680                Self::Unspecified => "WRITE_OP_UNSPECIFIED",
1681                Self::Insert => "WRITE_OP_INSERT",
1682                Self::Delete => "WRITE_OP_DELETE",
1683                Self::Update => "WRITE_OP_UPDATE",
1684                Self::Ctas => "WRITE_OP_CTAS",
1685            }
1686        }
1687        /// Creates an enum from field names used in the ProtoBuf definition.
1688        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1689            match value {
1690                "WRITE_OP_UNSPECIFIED" => Some(Self::Unspecified),
1691                "WRITE_OP_INSERT" => Some(Self::Insert),
1692                "WRITE_OP_DELETE" => Some(Self::Delete),
1693                "WRITE_OP_UPDATE" => Some(Self::Update),
1694                "WRITE_OP_CTAS" => Some(Self::Ctas),
1695                _ => None,
1696            }
1697        }
1698    }
1699    #[derive(
1700        Clone,
1701        Copy,
1702        Debug,
1703        PartialEq,
1704        Eq,
1705        Hash,
1706        PartialOrd,
1707        Ord,
1708        ::prost::Enumeration
1709    )]
1710    #[repr(i32)]
1711    pub enum CreateMode {
1712        Unspecified = 0,
1713        /// Append the data to the table if it already exists
1714        AppendIfExists = 1,
1715        /// Replace the table if it already exists ("OR REPLACE")
1716        ReplaceIfExists = 2,
1717        /// Ignore the request if the table already exists ("IF NOT EXISTS")
1718        IgnoreIfExists = 3,
1719        /// Throw an error if the table already exists (default behavior)
1720        ErrorIfExists = 4,
1721    }
1722    impl CreateMode {
1723        /// String value of the enum field names used in the ProtoBuf definition.
1724        ///
1725        /// The values are not transformed in any way and thus are considered stable
1726        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1727        pub fn as_str_name(&self) -> &'static str {
1728            match self {
1729                Self::Unspecified => "CREATE_MODE_UNSPECIFIED",
1730                Self::AppendIfExists => "CREATE_MODE_APPEND_IF_EXISTS",
1731                Self::ReplaceIfExists => "CREATE_MODE_REPLACE_IF_EXISTS",
1732                Self::IgnoreIfExists => "CREATE_MODE_IGNORE_IF_EXISTS",
1733                Self::ErrorIfExists => "CREATE_MODE_ERROR_IF_EXISTS",
1734            }
1735        }
1736        /// Creates an enum from field names used in the ProtoBuf definition.
1737        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1738            match value {
1739                "CREATE_MODE_UNSPECIFIED" => Some(Self::Unspecified),
1740                "CREATE_MODE_APPEND_IF_EXISTS" => Some(Self::AppendIfExists),
1741                "CREATE_MODE_REPLACE_IF_EXISTS" => Some(Self::ReplaceIfExists),
1742                "CREATE_MODE_IGNORE_IF_EXISTS" => Some(Self::IgnoreIfExists),
1743                "CREATE_MODE_ERROR_IF_EXISTS" => Some(Self::ErrorIfExists),
1744                _ => None,
1745            }
1746        }
1747    }
1748    #[derive(
1749        Clone,
1750        Copy,
1751        Debug,
1752        PartialEq,
1753        Eq,
1754        Hash,
1755        PartialOrd,
1756        Ord,
1757        ::prost::Enumeration
1758    )]
1759    #[repr(i32)]
1760    pub enum OutputMode {
1761        Unspecified = 0,
1762        /// return no records at all
1763        NoOutput = 1,
1764        /// this mode makes the operator return all the record INSERTED/DELETED/UPDATED by the operator.
1765        /// The operator returns the AFTER-image of any change. This can be further manipulated by operators upstreams
1766        /// (e.g., retunring the typical "count of modified records").
1767        /// For scenarios in which the BEFORE image is required, the user must implement a spool (via references to
1768        /// subplans in the body of the Rel input) and return those with anounter PlanRel.relations.
1769        ModifiedRecords = 2,
1770    }
1771    impl OutputMode {
1772        /// String value of the enum field names used in the ProtoBuf definition.
1773        ///
1774        /// The values are not transformed in any way and thus are considered stable
1775        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1776        pub fn as_str_name(&self) -> &'static str {
1777            match self {
1778                Self::Unspecified => "OUTPUT_MODE_UNSPECIFIED",
1779                Self::NoOutput => "OUTPUT_MODE_NO_OUTPUT",
1780                Self::ModifiedRecords => "OUTPUT_MODE_MODIFIED_RECORDS",
1781            }
1782        }
1783        /// Creates an enum from field names used in the ProtoBuf definition.
1784        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1785            match value {
1786                "OUTPUT_MODE_UNSPECIFIED" => Some(Self::Unspecified),
1787                "OUTPUT_MODE_NO_OUTPUT" => Some(Self::NoOutput),
1788                "OUTPUT_MODE_MODIFIED_RECORDS" => Some(Self::ModifiedRecords),
1789                _ => None,
1790            }
1791        }
1792    }
1793    /// Definition of which TABLE we are operating on
1794    #[derive(Clone, PartialEq, ::prost::Oneof)]
1795    pub enum WriteType {
1796        #[prost(message, tag = "1")]
1797        NamedTable(super::NamedObjectWrite),
1798        #[prost(message, tag = "2")]
1799        ExtensionTable(super::ExtensionObject),
1800    }
1801}
1802/// The operator that modifies the columns of a table
1803#[derive(Clone, PartialEq, ::prost::Message)]
1804pub struct UpdateRel {
1805    /// The full schema of the named_table
1806    #[prost(message, optional, tag = "2")]
1807    pub table_schema: ::core::option::Option<NamedStruct>,
1808    /// condition to be met for the update to be applied on a record
1809    #[prost(message, optional, boxed, tag = "3")]
1810    pub condition: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
1811    /// The list of transformations to apply to the columns of the named_table
1812    #[prost(message, repeated, tag = "4")]
1813    pub transformations: ::prost::alloc::vec::Vec<update_rel::TransformExpression>,
1814    #[prost(message, optional, tag = "5")]
1815    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1816    #[prost(oneof = "update_rel::UpdateType", tags = "1")]
1817    pub update_type: ::core::option::Option<update_rel::UpdateType>,
1818}
1819/// Nested message and enum types in `UpdateRel`.
1820pub mod update_rel {
1821    #[derive(Clone, PartialEq, ::prost::Message)]
1822    pub struct TransformExpression {
1823        /// the transformation to apply
1824        #[prost(message, optional, tag = "1")]
1825        pub transformation: ::core::option::Option<super::Expression>,
1826        /// index of the column to apply the transformation to
1827        #[prost(int32, tag = "2")]
1828        pub column_target: i32,
1829    }
1830    #[derive(Clone, PartialEq, ::prost::Oneof)]
1831    pub enum UpdateType {
1832        #[prost(message, tag = "1")]
1833        NamedTable(super::NamedTable),
1834    }
1835}
1836/// A base table. The list of string is used to represent namespacing (e.g., mydb.mytable).
1837/// This assumes shared catalog between systems exchanging a message.
1838#[derive(Clone, PartialEq, ::prost::Message)]
1839pub struct NamedTable {
1840    #[prost(string, repeated, tag = "1")]
1841    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1842    #[prost(message, optional, tag = "10")]
1843    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1844}
1845/// Hash joins and merge joins are a specialization of the general join where the join
1846/// expression is an series of comparisons between fields that are ANDed together.  The
1847/// behavior of this comparison is flexible
1848#[derive(Clone, PartialEq, ::prost::Message)]
1849pub struct ComparisonJoinKey {
1850    /// The key to compare from the left table
1851    #[prost(message, optional, tag = "1")]
1852    pub left: ::core::option::Option<expression::FieldReference>,
1853    /// The key to compare from the right table
1854    #[prost(message, optional, tag = "2")]
1855    pub right: ::core::option::Option<expression::FieldReference>,
1856    /// Describes how to compare the two keys
1857    #[prost(message, optional, tag = "3")]
1858    pub comparison: ::core::option::Option<comparison_join_key::ComparisonType>,
1859}
1860/// Nested message and enum types in `ComparisonJoinKey`.
1861pub mod comparison_join_key {
1862    /// Describes how the relation should consider if two rows are a match
1863    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1864    pub struct ComparisonType {
1865        #[prost(oneof = "comparison_type::InnerType", tags = "1, 2")]
1866        pub inner_type: ::core::option::Option<comparison_type::InnerType>,
1867    }
1868    /// Nested message and enum types in `ComparisonType`.
1869    pub mod comparison_type {
1870        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
1871        pub enum InnerType {
1872            /// One of the simple comparison behaviors is used
1873            #[prost(enumeration = "super::SimpleComparisonType", tag = "1")]
1874            Simple(i32),
1875            /// A custom comparison behavior is used.  This can happen, for example, when using
1876            /// collations, where we might want to do something like a case-insensitive comparison.
1877            ///
1878            /// This must be a binary function with a boolean return type.
1879            #[prost(uint32, tag = "2")]
1880            CustomFunctionReference(u32),
1881        }
1882    }
1883    /// Most joins will use one of the following behaviors.  To avoid the complexity
1884    /// of a function lookup we define the common behaviors here
1885    #[derive(
1886        Clone,
1887        Copy,
1888        Debug,
1889        PartialEq,
1890        Eq,
1891        Hash,
1892        PartialOrd,
1893        Ord,
1894        ::prost::Enumeration
1895    )]
1896    #[repr(i32)]
1897    pub enum SimpleComparisonType {
1898        Unspecified = 0,
1899        /// Returns true only if both values are equal and not null
1900        Eq = 1,
1901        /// Returns true if both values are equal and not null
1902        /// Returns true if both values are null
1903        /// Returns false if one value is null and the other value is not null
1904        ///
1905        /// This can be expressed as a = b OR (isnull(a) AND isnull(b))
1906        IsNotDistinctFrom = 2,
1907        /// Returns true if both values are equal and not null
1908        /// Returns true if either value is null
1909        ///
1910        /// This can be expressed as a = b OR isnull(a = b)
1911        MightEqual = 3,
1912    }
1913    impl SimpleComparisonType {
1914        /// String value of the enum field names used in the ProtoBuf definition.
1915        ///
1916        /// The values are not transformed in any way and thus are considered stable
1917        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1918        pub fn as_str_name(&self) -> &'static str {
1919            match self {
1920                Self::Unspecified => "SIMPLE_COMPARISON_TYPE_UNSPECIFIED",
1921                Self::Eq => "SIMPLE_COMPARISON_TYPE_EQ",
1922                Self::IsNotDistinctFrom => "SIMPLE_COMPARISON_TYPE_IS_NOT_DISTINCT_FROM",
1923                Self::MightEqual => "SIMPLE_COMPARISON_TYPE_MIGHT_EQUAL",
1924            }
1925        }
1926        /// Creates an enum from field names used in the ProtoBuf definition.
1927        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1928            match value {
1929                "SIMPLE_COMPARISON_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1930                "SIMPLE_COMPARISON_TYPE_EQ" => Some(Self::Eq),
1931                "SIMPLE_COMPARISON_TYPE_IS_NOT_DISTINCT_FROM" => {
1932                    Some(Self::IsNotDistinctFrom)
1933                }
1934                "SIMPLE_COMPARISON_TYPE_MIGHT_EQUAL" => Some(Self::MightEqual),
1935                _ => None,
1936            }
1937        }
1938    }
1939}
1940/// The hash equijoin operator will build a hash table out of one input (default `right`) based on a set of join keys.
1941/// It will then probe that hash table for the other input (default `left`), finding matches.
1942///
1943/// Two rows are a match if the comparison function returns true for all keys
1944#[derive(Clone, PartialEq, ::prost::Message)]
1945pub struct HashJoinRel {
1946    #[prost(message, optional, tag = "1")]
1947    pub common: ::core::option::Option<RelCommon>,
1948    #[prost(message, optional, boxed, tag = "2")]
1949    pub left: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
1950    #[prost(message, optional, boxed, tag = "3")]
1951    pub right: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
1952    /// These fields are deprecated in favor of `keys`.  If they are set then
1953    /// the two lists (left_keys and right_keys) must have the same length and
1954    /// the comparion function is considered to be SimpleEqualityType::EQ
1955    #[deprecated]
1956    #[prost(message, repeated, tag = "4")]
1957    pub left_keys: ::prost::alloc::vec::Vec<expression::FieldReference>,
1958    #[deprecated]
1959    #[prost(message, repeated, tag = "5")]
1960    pub right_keys: ::prost::alloc::vec::Vec<expression::FieldReference>,
1961    /// One or more keys to join on.  The relation is invalid if this is empty
1962    /// (unless the deprecated left_keys/right_keys fields are being used).
1963    ///
1964    /// If a custom comparison function is used then it must be consistent with
1965    /// the hash function used for the keys.
1966    ///
1967    /// In other words, the hash function must return the same hash code when the
1968    /// comparison returns true.  For example, if the comparison function is
1969    /// "equals ignoring case" then the hash function must return the same hash
1970    /// code for strings that differ only by case.  Note: the hash function is not
1971    /// specified here.  It is the responsibility of the consumer to find an appropriate
1972    /// hash function for a given comparsion function or to reject the plan if it cannot
1973    /// do so.
1974    #[prost(message, repeated, tag = "8")]
1975    pub keys: ::prost::alloc::vec::Vec<ComparisonJoinKey>,
1976    #[prost(message, optional, boxed, tag = "6")]
1977    pub post_join_filter: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
1978    #[prost(enumeration = "hash_join_rel::JoinType", tag = "7")]
1979    pub r#type: i32,
1980    /// Specifies which side of input to build the hash table for this hash join. Default is `BUILD_INPUT_RIGHT`.
1981    #[prost(enumeration = "hash_join_rel::BuildInput", tag = "9")]
1982    pub build_input: i32,
1983    #[prost(message, optional, tag = "10")]
1984    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
1985}
1986/// Nested message and enum types in `HashJoinRel`.
1987pub mod hash_join_rel {
1988    #[derive(
1989        Clone,
1990        Copy,
1991        Debug,
1992        PartialEq,
1993        Eq,
1994        Hash,
1995        PartialOrd,
1996        Ord,
1997        ::prost::Enumeration
1998    )]
1999    #[repr(i32)]
2000    pub enum JoinType {
2001        Unspecified = 0,
2002        Inner = 1,
2003        Outer = 2,
2004        Left = 3,
2005        Right = 4,
2006        LeftSemi = 5,
2007        RightSemi = 6,
2008        LeftAnti = 7,
2009        RightAnti = 8,
2010        LeftSingle = 9,
2011        RightSingle = 10,
2012        LeftMark = 11,
2013        RightMark = 12,
2014    }
2015    impl JoinType {
2016        /// String value of the enum field names used in the ProtoBuf definition.
2017        ///
2018        /// The values are not transformed in any way and thus are considered stable
2019        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2020        pub fn as_str_name(&self) -> &'static str {
2021            match self {
2022                Self::Unspecified => "JOIN_TYPE_UNSPECIFIED",
2023                Self::Inner => "JOIN_TYPE_INNER",
2024                Self::Outer => "JOIN_TYPE_OUTER",
2025                Self::Left => "JOIN_TYPE_LEFT",
2026                Self::Right => "JOIN_TYPE_RIGHT",
2027                Self::LeftSemi => "JOIN_TYPE_LEFT_SEMI",
2028                Self::RightSemi => "JOIN_TYPE_RIGHT_SEMI",
2029                Self::LeftAnti => "JOIN_TYPE_LEFT_ANTI",
2030                Self::RightAnti => "JOIN_TYPE_RIGHT_ANTI",
2031                Self::LeftSingle => "JOIN_TYPE_LEFT_SINGLE",
2032                Self::RightSingle => "JOIN_TYPE_RIGHT_SINGLE",
2033                Self::LeftMark => "JOIN_TYPE_LEFT_MARK",
2034                Self::RightMark => "JOIN_TYPE_RIGHT_MARK",
2035            }
2036        }
2037        /// Creates an enum from field names used in the ProtoBuf definition.
2038        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2039            match value {
2040                "JOIN_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
2041                "JOIN_TYPE_INNER" => Some(Self::Inner),
2042                "JOIN_TYPE_OUTER" => Some(Self::Outer),
2043                "JOIN_TYPE_LEFT" => Some(Self::Left),
2044                "JOIN_TYPE_RIGHT" => Some(Self::Right),
2045                "JOIN_TYPE_LEFT_SEMI" => Some(Self::LeftSemi),
2046                "JOIN_TYPE_RIGHT_SEMI" => Some(Self::RightSemi),
2047                "JOIN_TYPE_LEFT_ANTI" => Some(Self::LeftAnti),
2048                "JOIN_TYPE_RIGHT_ANTI" => Some(Self::RightAnti),
2049                "JOIN_TYPE_LEFT_SINGLE" => Some(Self::LeftSingle),
2050                "JOIN_TYPE_RIGHT_SINGLE" => Some(Self::RightSingle),
2051                "JOIN_TYPE_LEFT_MARK" => Some(Self::LeftMark),
2052                "JOIN_TYPE_RIGHT_MARK" => Some(Self::RightMark),
2053                _ => None,
2054            }
2055        }
2056    }
2057    #[derive(
2058        Clone,
2059        Copy,
2060        Debug,
2061        PartialEq,
2062        Eq,
2063        Hash,
2064        PartialOrd,
2065        Ord,
2066        ::prost::Enumeration
2067    )]
2068    #[repr(i32)]
2069    pub enum BuildInput {
2070        Unspecified = 0,
2071        Left = 1,
2072        Right = 2,
2073    }
2074    impl BuildInput {
2075        /// String value of the enum field names used in the ProtoBuf definition.
2076        ///
2077        /// The values are not transformed in any way and thus are considered stable
2078        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2079        pub fn as_str_name(&self) -> &'static str {
2080            match self {
2081                Self::Unspecified => "BUILD_INPUT_UNSPECIFIED",
2082                Self::Left => "BUILD_INPUT_LEFT",
2083                Self::Right => "BUILD_INPUT_RIGHT",
2084            }
2085        }
2086        /// Creates an enum from field names used in the ProtoBuf definition.
2087        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2088            match value {
2089                "BUILD_INPUT_UNSPECIFIED" => Some(Self::Unspecified),
2090                "BUILD_INPUT_LEFT" => Some(Self::Left),
2091                "BUILD_INPUT_RIGHT" => Some(Self::Right),
2092                _ => None,
2093            }
2094        }
2095    }
2096}
2097/// The merge equijoin does a join by taking advantage of two sets that are sorted on the join keys.
2098/// This allows the join operation to be done in a streaming fashion.
2099#[derive(Clone, PartialEq, ::prost::Message)]
2100pub struct MergeJoinRel {
2101    #[prost(message, optional, tag = "1")]
2102    pub common: ::core::option::Option<RelCommon>,
2103    #[prost(message, optional, boxed, tag = "2")]
2104    pub left: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
2105    #[prost(message, optional, boxed, tag = "3")]
2106    pub right: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
2107    /// These fields are deprecated in favor of `keys`.  If they are set then
2108    /// the two lists (left_keys and right_keys) must have the same length and
2109    /// the comparion function is considered to be SimpleEqualityType::EQ
2110    #[deprecated]
2111    #[prost(message, repeated, tag = "4")]
2112    pub left_keys: ::prost::alloc::vec::Vec<expression::FieldReference>,
2113    #[deprecated]
2114    #[prost(message, repeated, tag = "5")]
2115    pub right_keys: ::prost::alloc::vec::Vec<expression::FieldReference>,
2116    /// One or more keys to join on.  The relation is invalid if this is empty
2117    /// (unless the deprecated left_keys/right_keys fields are being used).
2118    ///
2119    /// If a custom comparison function is used then it must be consistent with
2120    /// the ordering of the input data.  For example, if the comparison function
2121    /// is "<" then we generally expect the data to be sorted in ascending order.
2122    ///
2123    /// If the comparison function is something like "less than ignoring case" then
2124    /// the data should be sorted appropriately (e.g. both "A" and "a" should come
2125    /// before "b")
2126    ///
2127    /// The sort order is not specified here.  It is typically the responsibility of
2128    /// the producer to ensure the plan sorts the data if needed (although the consumer
2129    /// is free to do so as well).  If possible, the consumer should verify the sort
2130    /// order and reject invalid plans.
2131    #[prost(message, repeated, tag = "8")]
2132    pub keys: ::prost::alloc::vec::Vec<ComparisonJoinKey>,
2133    #[prost(message, optional, boxed, tag = "6")]
2134    pub post_join_filter: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
2135    #[prost(enumeration = "merge_join_rel::JoinType", tag = "7")]
2136    pub r#type: i32,
2137    #[prost(message, optional, tag = "10")]
2138    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
2139}
2140/// Nested message and enum types in `MergeJoinRel`.
2141pub mod merge_join_rel {
2142    #[derive(
2143        Clone,
2144        Copy,
2145        Debug,
2146        PartialEq,
2147        Eq,
2148        Hash,
2149        PartialOrd,
2150        Ord,
2151        ::prost::Enumeration
2152    )]
2153    #[repr(i32)]
2154    pub enum JoinType {
2155        Unspecified = 0,
2156        Inner = 1,
2157        Outer = 2,
2158        Left = 3,
2159        Right = 4,
2160        LeftSemi = 5,
2161        RightSemi = 6,
2162        LeftAnti = 7,
2163        RightAnti = 8,
2164        LeftSingle = 9,
2165        RightSingle = 10,
2166        LeftMark = 11,
2167        RightMark = 12,
2168    }
2169    impl JoinType {
2170        /// String value of the enum field names used in the ProtoBuf definition.
2171        ///
2172        /// The values are not transformed in any way and thus are considered stable
2173        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2174        pub fn as_str_name(&self) -> &'static str {
2175            match self {
2176                Self::Unspecified => "JOIN_TYPE_UNSPECIFIED",
2177                Self::Inner => "JOIN_TYPE_INNER",
2178                Self::Outer => "JOIN_TYPE_OUTER",
2179                Self::Left => "JOIN_TYPE_LEFT",
2180                Self::Right => "JOIN_TYPE_RIGHT",
2181                Self::LeftSemi => "JOIN_TYPE_LEFT_SEMI",
2182                Self::RightSemi => "JOIN_TYPE_RIGHT_SEMI",
2183                Self::LeftAnti => "JOIN_TYPE_LEFT_ANTI",
2184                Self::RightAnti => "JOIN_TYPE_RIGHT_ANTI",
2185                Self::LeftSingle => "JOIN_TYPE_LEFT_SINGLE",
2186                Self::RightSingle => "JOIN_TYPE_RIGHT_SINGLE",
2187                Self::LeftMark => "JOIN_TYPE_LEFT_MARK",
2188                Self::RightMark => "JOIN_TYPE_RIGHT_MARK",
2189            }
2190        }
2191        /// Creates an enum from field names used in the ProtoBuf definition.
2192        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2193            match value {
2194                "JOIN_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
2195                "JOIN_TYPE_INNER" => Some(Self::Inner),
2196                "JOIN_TYPE_OUTER" => Some(Self::Outer),
2197                "JOIN_TYPE_LEFT" => Some(Self::Left),
2198                "JOIN_TYPE_RIGHT" => Some(Self::Right),
2199                "JOIN_TYPE_LEFT_SEMI" => Some(Self::LeftSemi),
2200                "JOIN_TYPE_RIGHT_SEMI" => Some(Self::RightSemi),
2201                "JOIN_TYPE_LEFT_ANTI" => Some(Self::LeftAnti),
2202                "JOIN_TYPE_RIGHT_ANTI" => Some(Self::RightAnti),
2203                "JOIN_TYPE_LEFT_SINGLE" => Some(Self::LeftSingle),
2204                "JOIN_TYPE_RIGHT_SINGLE" => Some(Self::RightSingle),
2205                "JOIN_TYPE_LEFT_MARK" => Some(Self::LeftMark),
2206                "JOIN_TYPE_RIGHT_MARK" => Some(Self::RightMark),
2207                _ => None,
2208            }
2209        }
2210    }
2211}
2212/// The nested loop join (NLJ) operator will hold the entire right input and iterate over it using the
2213/// left input, evaluating the join expression on the Cartesian product of all rows.
2214#[derive(Clone, PartialEq, ::prost::Message)]
2215pub struct NestedLoopJoinRel {
2216    #[prost(message, optional, tag = "1")]
2217    pub common: ::core::option::Option<RelCommon>,
2218    #[prost(message, optional, boxed, tag = "2")]
2219    pub left: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
2220    #[prost(message, optional, boxed, tag = "3")]
2221    pub right: ::core::option::Option<::prost::alloc::boxed::Box<Rel>>,
2222    /// optional, defaults to true (a cartesian join)
2223    #[prost(message, optional, boxed, tag = "4")]
2224    pub expression: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
2225    #[prost(enumeration = "nested_loop_join_rel::JoinType", tag = "5")]
2226    pub r#type: i32,
2227    #[prost(message, optional, tag = "10")]
2228    pub advanced_extension: ::core::option::Option<extensions::AdvancedExtension>,
2229}
2230/// Nested message and enum types in `NestedLoopJoinRel`.
2231pub mod nested_loop_join_rel {
2232    #[derive(
2233        Clone,
2234        Copy,
2235        Debug,
2236        PartialEq,
2237        Eq,
2238        Hash,
2239        PartialOrd,
2240        Ord,
2241        ::prost::Enumeration
2242    )]
2243    #[repr(i32)]
2244    pub enum JoinType {
2245        Unspecified = 0,
2246        Inner = 1,
2247        Outer = 2,
2248        Left = 3,
2249        Right = 4,
2250        LeftSemi = 5,
2251        RightSemi = 6,
2252        LeftAnti = 7,
2253        RightAnti = 8,
2254        LeftSingle = 9,
2255        RightSingle = 10,
2256        LeftMark = 11,
2257        RightMark = 12,
2258    }
2259    impl JoinType {
2260        /// String value of the enum field names used in the ProtoBuf definition.
2261        ///
2262        /// The values are not transformed in any way and thus are considered stable
2263        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2264        pub fn as_str_name(&self) -> &'static str {
2265            match self {
2266                Self::Unspecified => "JOIN_TYPE_UNSPECIFIED",
2267                Self::Inner => "JOIN_TYPE_INNER",
2268                Self::Outer => "JOIN_TYPE_OUTER",
2269                Self::Left => "JOIN_TYPE_LEFT",
2270                Self::Right => "JOIN_TYPE_RIGHT",
2271                Self::LeftSemi => "JOIN_TYPE_LEFT_SEMI",
2272                Self::RightSemi => "JOIN_TYPE_RIGHT_SEMI",
2273                Self::LeftAnti => "JOIN_TYPE_LEFT_ANTI",
2274                Self::RightAnti => "JOIN_TYPE_RIGHT_ANTI",
2275                Self::LeftSingle => "JOIN_TYPE_LEFT_SINGLE",
2276                Self::RightSingle => "JOIN_TYPE_RIGHT_SINGLE",
2277                Self::LeftMark => "JOIN_TYPE_LEFT_MARK",
2278                Self::RightMark => "JOIN_TYPE_RIGHT_MARK",
2279            }
2280        }
2281        /// Creates an enum from field names used in the ProtoBuf definition.
2282        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2283            match value {
2284                "JOIN_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
2285                "JOIN_TYPE_INNER" => Some(Self::Inner),
2286                "JOIN_TYPE_OUTER" => Some(Self::Outer),
2287                "JOIN_TYPE_LEFT" => Some(Self::Left),
2288                "JOIN_TYPE_RIGHT" => Some(Self::Right),
2289                "JOIN_TYPE_LEFT_SEMI" => Some(Self::LeftSemi),
2290                "JOIN_TYPE_RIGHT_SEMI" => Some(Self::RightSemi),
2291                "JOIN_TYPE_LEFT_ANTI" => Some(Self::LeftAnti),
2292                "JOIN_TYPE_RIGHT_ANTI" => Some(Self::RightAnti),
2293                "JOIN_TYPE_LEFT_SINGLE" => Some(Self::LeftSingle),
2294                "JOIN_TYPE_RIGHT_SINGLE" => Some(Self::RightSingle),
2295                "JOIN_TYPE_LEFT_MARK" => Some(Self::LeftMark),
2296                "JOIN_TYPE_RIGHT_MARK" => Some(Self::RightMark),
2297                _ => None,
2298            }
2299        }
2300    }
2301}
2302/// The argument of a function
2303#[derive(Clone, PartialEq, ::prost::Message)]
2304pub struct FunctionArgument {
2305    #[prost(oneof = "function_argument::ArgType", tags = "1, 2, 3")]
2306    pub arg_type: ::core::option::Option<function_argument::ArgType>,
2307}
2308/// Nested message and enum types in `FunctionArgument`.
2309pub mod function_argument {
2310    #[derive(Clone, PartialEq, ::prost::Oneof)]
2311    pub enum ArgType {
2312        #[prost(string, tag = "1")]
2313        Enum(::prost::alloc::string::String),
2314        #[prost(message, tag = "2")]
2315        Type(super::Type),
2316        #[prost(message, tag = "3")]
2317        Value(super::Expression),
2318    }
2319}
2320/// An optional function argument.  Typically used for specifying behavior in
2321/// invalid or corner cases.
2322#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2323pub struct FunctionOption {
2324    /// Name of the option to set. If the consumer does not recognize the
2325    /// option, it must reject the plan. The name is matched case-insensitively
2326    /// with option names defined for the function.
2327    #[prost(string, tag = "1")]
2328    pub name: ::prost::alloc::string::String,
2329    /// List of behavior options allowed by the producer. At least one must be
2330    /// specified; to leave an option unspecified, simply don't add an entry to
2331    /// `options`. The consumer must use the first option from the list that it
2332    /// supports. If the consumer supports none of the specified options, it
2333    /// must reject the plan. The name is matched case-insensitively and must
2334    /// match one of the option values defined for the option.
2335    #[prost(string, repeated, tag = "2")]
2336    pub preference: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2337}
2338#[derive(Clone, PartialEq, ::prost::Message)]
2339pub struct Expression {
2340    #[prost(
2341        oneof = "expression::RexType",
2342        tags = "1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 10"
2343    )]
2344    pub rex_type: ::core::option::Option<expression::RexType>,
2345}
2346/// Nested message and enum types in `Expression`.
2347pub mod expression {
2348    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2349    pub struct Enum {
2350        #[prost(oneof = "r#enum::EnumKind", tags = "1, 2")]
2351        pub enum_kind: ::core::option::Option<r#enum::EnumKind>,
2352    }
2353    /// Nested message and enum types in `Enum`.
2354    pub mod r#enum {
2355        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2356        pub struct Empty {}
2357        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2358        pub enum EnumKind {
2359            #[prost(string, tag = "1")]
2360            Specified(::prost::alloc::string::String),
2361            #[prost(message, tag = "2")]
2362            Unspecified(Empty),
2363        }
2364    }
2365    #[derive(Clone, PartialEq, ::prost::Message)]
2366    pub struct Literal {
2367        /// Whether the literal_type above should be treated as a nullable type.
2368        /// Applies to all members of the literal_type oneof EXCEPT:
2369        ///   * Type null             (must be nullable by definition)
2370        ///   * Type.List empty_list  (use Type.List::nullability)
2371        ///   * Type.Map empty_map    (use Type.Map::nullability)
2372        #[prost(bool, tag = "50")]
2373        pub nullable: bool,
2374        /// optionally points to a type_variation_anchor defined in this plan.
2375        /// Applies to all members of union other than the Typed null (which should
2376        /// directly declare the type variation).
2377        #[prost(uint32, tag = "51")]
2378        pub type_variation_reference: u32,
2379        #[prost(
2380            oneof = "literal::LiteralType",
2381            tags = "1, 2, 3, 5, 7, 10, 11, 12, 13, 14, 16, 17, 19, 20, 36, 21, 22, 23, 24, 37, 34, 35, 25, 26, 27, 28, 29, 30, 31, 32, 33"
2382        )]
2383        pub literal_type: ::core::option::Option<literal::LiteralType>,
2384    }
2385    /// Nested message and enum types in `Literal`.
2386    pub mod literal {
2387        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2388        pub struct VarChar {
2389            #[prost(string, tag = "1")]
2390            pub value: ::prost::alloc::string::String,
2391            #[prost(uint32, tag = "2")]
2392            pub length: u32,
2393        }
2394        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2395        pub struct Decimal {
2396            /// little-endian twos-complement integer representation of complete value
2397            /// (ignoring precision) Always 16 bytes in length
2398            #[prost(bytes = "vec", tag = "1")]
2399            pub value: ::prost::alloc::vec::Vec<u8>,
2400            /// The maximum number of digits allowed in the value.
2401            /// the maximum precision is 38.
2402            #[prost(int32, tag = "2")]
2403            pub precision: i32,
2404            /// declared scale of decimal literal
2405            #[prost(int32, tag = "3")]
2406            pub scale: i32,
2407        }
2408        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2409        pub struct PrecisionTime {
2410            /// Sub-second precision, 0 means the value given is in seconds, 3 is milliseconds, 6 microseconds, 9 is nanoseconds, 12 is picoseconds
2411            #[prost(int32, tag = "1")]
2412            pub precision: i32,
2413            /// Time passed since midnight in precision units.
2414            #[prost(int64, tag = "2")]
2415            pub value: i64,
2416        }
2417        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2418        pub struct PrecisionTimestamp {
2419            /// Sub-second precision, 0 means the value given is in seconds, 3 is milliseconds, 6 microseconds, 9 is nanoseconds, 12 is picoseconds
2420            #[prost(int32, tag = "1")]
2421            pub precision: i32,
2422            /// Time passed since 1970-01-01 00:00:00.000000 in UTC for PrecisionTimestampTZ and unspecified timezone for PrecisionTimestamp
2423            #[prost(int64, tag = "2")]
2424            pub value: i64,
2425        }
2426        #[derive(Clone, PartialEq, ::prost::Message)]
2427        pub struct Map {
2428            #[prost(message, repeated, tag = "1")]
2429            pub key_values: ::prost::alloc::vec::Vec<map::KeyValue>,
2430        }
2431        /// Nested message and enum types in `Map`.
2432        pub mod map {
2433            #[derive(Clone, PartialEq, ::prost::Message)]
2434            pub struct KeyValue {
2435                #[prost(message, optional, tag = "1")]
2436                pub key: ::core::option::Option<super::super::Literal>,
2437                #[prost(message, optional, tag = "2")]
2438                pub value: ::core::option::Option<super::super::Literal>,
2439            }
2440        }
2441        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2442        pub struct IntervalYearToMonth {
2443            #[prost(int32, tag = "1")]
2444            pub years: i32,
2445            #[prost(int32, tag = "2")]
2446            pub months: i32,
2447        }
2448        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2449        pub struct IntervalDayToSecond {
2450            #[prost(int32, tag = "1")]
2451            pub days: i32,
2452            #[prost(int32, tag = "2")]
2453            pub seconds: i32,
2454            /// the number of fractional seconds using 1e(-precision) units. Should only be used with precision field, not microseconds.
2455            #[prost(int64, tag = "5")]
2456            pub subseconds: i64,
2457            /// Consumers should expect either (miroseconds) to be set or (precision and subseconds) to be set
2458            #[prost(oneof = "interval_day_to_second::PrecisionMode", tags = "3, 4")]
2459            pub precision_mode: ::core::option::Option<
2460                interval_day_to_second::PrecisionMode,
2461            >,
2462        }
2463        /// Nested message and enum types in `IntervalDayToSecond`.
2464        pub mod interval_day_to_second {
2465            /// Consumers should expect either (miroseconds) to be set or (precision and subseconds) to be set
2466            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
2467            pub enum PrecisionMode {
2468                /// use precision and subseconds below, they cover and replace microseconds.
2469                #[prost(int32, tag = "3")]
2470                Microseconds(i32),
2471                /// Sub-second precision, 0 means the value given is in seconds, 3 is milliseconds, 6 microseconds, 9 is nanoseconds. Should be used with subseconds below.
2472                #[prost(int32, tag = "4")]
2473                Precision(i32),
2474            }
2475        }
2476        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2477        pub struct IntervalCompound {
2478            #[prost(message, optional, tag = "1")]
2479            pub interval_year_to_month: ::core::option::Option<IntervalYearToMonth>,
2480            #[prost(message, optional, tag = "2")]
2481            pub interval_day_to_second: ::core::option::Option<IntervalDayToSecond>,
2482        }
2483        #[derive(Clone, PartialEq, ::prost::Message)]
2484        pub struct Struct {
2485            /// A possibly heterogeneously typed list of literals
2486            #[prost(message, repeated, tag = "1")]
2487            pub fields: ::prost::alloc::vec::Vec<super::Literal>,
2488        }
2489        #[derive(Clone, PartialEq, ::prost::Message)]
2490        pub struct List {
2491            /// A homogeneously typed list of literals
2492            #[prost(message, repeated, tag = "1")]
2493            pub values: ::prost::alloc::vec::Vec<super::Literal>,
2494        }
2495        #[derive(Clone, PartialEq, ::prost::Message)]
2496        pub struct UserDefined {
2497            /// The parameters to be bound to the type class, if the type class is
2498            /// parameterizable.
2499            #[prost(message, repeated, tag = "3")]
2500            pub type_parameters: ::prost::alloc::vec::Vec<
2501                super::super::r#type::Parameter,
2502            >,
2503            #[prost(oneof = "user_defined::TypeAnchorType", tags = "1, 5")]
2504            pub type_anchor_type: ::core::option::Option<user_defined::TypeAnchorType>,
2505            /// a user-defined literal can be encoded in one of two ways
2506            #[prost(oneof = "user_defined::Val", tags = "2, 4")]
2507            pub val: ::core::option::Option<user_defined::Val>,
2508        }
2509        /// Nested message and enum types in `UserDefined`.
2510        pub mod user_defined {
2511            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
2512            pub enum TypeAnchorType {
2513                /// points to a type_anchor defined in this plan
2514                #[prost(uint32, tag = "1")]
2515                TypeReference(u32),
2516                /// points to a type_alias_anchor defined in this plan.
2517                #[prost(uint32, tag = "5")]
2518                TypeAliasReference(u32),
2519            }
2520            /// a user-defined literal can be encoded in one of two ways
2521            #[derive(Clone, PartialEq, ::prost::Oneof)]
2522            pub enum Val {
2523                /// the value of the literal, serialized using some type-specific protobuf message
2524                #[prost(message, tag = "2")]
2525                Value(::pbjson_types::Any),
2526                /// the value of the literal, serialized using the structure definition in its declaration
2527                #[prost(message, tag = "4")]
2528                Struct(super::Struct),
2529            }
2530        }
2531        #[derive(Clone, PartialEq, ::prost::Oneof)]
2532        pub enum LiteralType {
2533            #[prost(bool, tag = "1")]
2534            Boolean(bool),
2535            #[prost(int32, tag = "2")]
2536            I8(i32),
2537            #[prost(int32, tag = "3")]
2538            I16(i32),
2539            #[prost(int32, tag = "5")]
2540            I32(i32),
2541            #[prost(int64, tag = "7")]
2542            I64(i64),
2543            #[prost(float, tag = "10")]
2544            Fp32(f32),
2545            #[prost(double, tag = "11")]
2546            Fp64(f64),
2547            #[prost(string, tag = "12")]
2548            String(::prost::alloc::string::String),
2549            #[prost(bytes, tag = "13")]
2550            Binary(::prost::alloc::vec::Vec<u8>),
2551            /// Timestamp in units of microseconds since the UNIX epoch.
2552            /// Deprecated in favor of `precision_timestamp`.
2553            #[prost(int64, tag = "14")]
2554            Timestamp(i64),
2555            /// Date in units of days since the UNIX epoch.
2556            #[prost(int32, tag = "16")]
2557            Date(i32),
2558            /// Time in units of microseconds past midnight.
2559            /// Deprecated in favor of `precision_time`.
2560            #[prost(int64, tag = "17")]
2561            Time(i64),
2562            #[prost(message, tag = "19")]
2563            IntervalYearToMonth(IntervalYearToMonth),
2564            #[prost(message, tag = "20")]
2565            IntervalDayToSecond(IntervalDayToSecond),
2566            #[prost(message, tag = "36")]
2567            IntervalCompound(IntervalCompound),
2568            #[prost(string, tag = "21")]
2569            FixedChar(::prost::alloc::string::String),
2570            #[prost(message, tag = "22")]
2571            VarChar(VarChar),
2572            #[prost(bytes, tag = "23")]
2573            FixedBinary(::prost::alloc::vec::Vec<u8>),
2574            #[prost(message, tag = "24")]
2575            Decimal(Decimal),
2576            /// Time in precision units past midnight.
2577            #[prost(message, tag = "37")]
2578            PrecisionTime(PrecisionTime),
2579            #[prost(message, tag = "34")]
2580            PrecisionTimestamp(PrecisionTimestamp),
2581            #[prost(message, tag = "35")]
2582            PrecisionTimestampTz(PrecisionTimestamp),
2583            #[prost(message, tag = "25")]
2584            Struct(Struct),
2585            #[prost(message, tag = "26")]
2586            Map(Map),
2587            /// Timestamp in units of microseconds since the UNIX epoch.
2588            /// Deprecated in favor of `precision_timestamp_tz`
2589            #[prost(int64, tag = "27")]
2590            TimestampTz(i64),
2591            #[prost(bytes, tag = "28")]
2592            Uuid(::prost::alloc::vec::Vec<u8>),
2593            /// a typed null literal
2594            #[prost(message, tag = "29")]
2595            Null(super::super::Type),
2596            #[prost(message, tag = "30")]
2597            List(List),
2598            #[prost(message, tag = "31")]
2599            EmptyList(super::super::r#type::List),
2600            #[prost(message, tag = "32")]
2601            EmptyMap(super::super::r#type::Map),
2602            #[prost(message, tag = "33")]
2603            UserDefined(UserDefined),
2604        }
2605    }
2606    /// Expression to dynamically construct nested types.
2607    #[derive(Clone, PartialEq, ::prost::Message)]
2608    pub struct Nested {
2609        /// Whether the returned nested type is nullable.
2610        #[prost(bool, tag = "1")]
2611        pub nullable: bool,
2612        /// Optionally points to a type_variation_anchor defined in this plan for
2613        /// the returned nested type.
2614        #[prost(uint32, tag = "2")]
2615        pub type_variation_reference: u32,
2616        #[prost(oneof = "nested::NestedType", tags = "3, 4, 5")]
2617        pub nested_type: ::core::option::Option<nested::NestedType>,
2618    }
2619    /// Nested message and enum types in `Nested`.
2620    pub mod nested {
2621        #[derive(Clone, PartialEq, ::prost::Message)]
2622        pub struct Map {
2623            /// One or more key-value pairs. To specify an empty map, use
2624            /// Literal.empty_map (otherwise type information would be missing).
2625            #[prost(message, repeated, tag = "1")]
2626            pub key_values: ::prost::alloc::vec::Vec<map::KeyValue>,
2627        }
2628        /// Nested message and enum types in `Map`.
2629        pub mod map {
2630            #[derive(Clone, PartialEq, ::prost::Message)]
2631            pub struct KeyValue {
2632                /// Mandatory key/value expressions.
2633                #[prost(message, optional, tag = "1")]
2634                pub key: ::core::option::Option<super::super::super::Expression>,
2635                #[prost(message, optional, tag = "2")]
2636                pub value: ::core::option::Option<super::super::super::Expression>,
2637            }
2638        }
2639        #[derive(Clone, PartialEq, ::prost::Message)]
2640        pub struct Struct {
2641            /// Zero or more possibly heterogeneously-typed list of expressions that
2642            /// form the struct fields.
2643            #[prost(message, repeated, tag = "1")]
2644            pub fields: ::prost::alloc::vec::Vec<super::super::Expression>,
2645        }
2646        #[derive(Clone, PartialEq, ::prost::Message)]
2647        pub struct List {
2648            /// A homogeneously-typed list of one or more expressions that form the
2649            /// list entries. To specify an empty list, use Literal.empty_list
2650            /// (otherwise type information would be missing).
2651            #[prost(message, repeated, tag = "1")]
2652            pub values: ::prost::alloc::vec::Vec<super::super::Expression>,
2653        }
2654        #[derive(Clone, PartialEq, ::prost::Oneof)]
2655        pub enum NestedType {
2656            #[prost(message, tag = "3")]
2657            Struct(Struct),
2658            #[prost(message, tag = "4")]
2659            List(List),
2660            #[prost(message, tag = "5")]
2661            Map(Map),
2662        }
2663    }
2664    /// A lambda expression representing an inline, anonymous function.
2665    /// Lambda expressions have parameters and a body expression that can reference
2666    /// those parameters using FieldReference with FieldReference.LambdaParameterReference as the root_type.
2667    #[derive(Clone, PartialEq, ::prost::Message)]
2668    pub struct Lambda {
2669        /// Parameters this lambda accepts, represented as a struct where each field corresponds
2670        /// to a parameter. Parameters can be accessed using FieldReference with
2671        /// FieldReference.LambdaParameterReference as root_type and StructField to select
2672        /// specific parameters. The struct's nullability must be NULLABILITY_REQUIRED.
2673        #[prost(message, optional, tag = "1")]
2674        pub parameters: ::core::option::Option<super::r#type::Struct>,
2675        /// The lambda body expression. Lambda parameters can be referenced using FieldReference
2676        /// with FieldReference.LambdaParameterReference as root_type.
2677        #[prost(message, optional, boxed, tag = "2")]
2678        pub body: ::core::option::Option<::prost::alloc::boxed::Box<super::Expression>>,
2679    }
2680    /// Invokes an inline lambda expression with provided arguments.
2681    /// Enables immediate invocation patterns like: ((x) -> x * 2)(5)
2682    ///
2683    /// The return type is derived from the type of the lambda's body expression.
2684    #[derive(Clone, PartialEq, ::prost::Message)]
2685    pub struct LambdaInvocation {
2686        /// The lambda expression to invoke.
2687        #[prost(message, optional, boxed, tag = "1")]
2688        pub lambda: ::core::option::Option<::prost::alloc::boxed::Box<Lambda>>,
2689        /// Arguments to pass to the lambda, as a struct expression. The struct must have
2690        /// exactly one Expression field for each lambda parameter, and the expression at
2691        /// each position must have a type that matches the corresponding parameter type.
2692        #[prost(message, optional, tag = "2")]
2693        pub arguments: ::core::option::Option<nested::Struct>,
2694    }
2695    /// A scalar function call.
2696    #[derive(Clone, PartialEq, ::prost::Message)]
2697    pub struct ScalarFunction {
2698        /// Points to a function_anchor defined in this plan, which must refer
2699        /// to a scalar function in the associated YAML file. Required.
2700        #[prost(uint32, tag = "1")]
2701        pub function_reference: u32,
2702        /// The arguments to be bound to the function. This must have exactly the
2703        /// number of arguments specified in the function definition, and the
2704        /// argument types must also match exactly:
2705        ///
2706        ///   - Value arguments must be bound using FunctionArgument.value, and
2707        ///     the expression in that must yield a value of a type that a function
2708        ///     overload is defined for.
2709        ///   - Type arguments must be bound using FunctionArgument.type.
2710        ///   - Enum arguments must be bound using FunctionArgument.enum
2711        ///     followed by Enum.specified, with a string that case-insensitively
2712        ///     matches one of the allowed options.
2713        #[prost(message, repeated, tag = "4")]
2714        pub arguments: ::prost::alloc::vec::Vec<super::FunctionArgument>,
2715        /// Options to specify behavior for corner cases, or leave behavior
2716        /// unspecified if the consumer does not need specific behavior in these
2717        /// cases.
2718        #[prost(message, repeated, tag = "5")]
2719        pub options: ::prost::alloc::vec::Vec<super::FunctionOption>,
2720        /// Must be set to the return type of the function, exactly as derived
2721        /// using the declaration in the extension.
2722        #[prost(message, optional, tag = "3")]
2723        pub output_type: ::core::option::Option<super::Type>,
2724        /// Deprecated; use arguments instead.
2725        #[deprecated]
2726        #[prost(message, repeated, tag = "2")]
2727        pub args: ::prost::alloc::vec::Vec<super::Expression>,
2728    }
2729    /// A window function call.
2730    #[derive(Clone, PartialEq, ::prost::Message)]
2731    pub struct WindowFunction {
2732        /// Points to a function_anchor defined in this plan. The function must be:
2733        ///   - a window function
2734        ///   - an aggregate function
2735        ///
2736        /// An aggregate function referenced here should be treated as a window
2737        /// function with Window Type STREAMING
2738        ///
2739        /// Required.
2740        #[prost(uint32, tag = "1")]
2741        pub function_reference: u32,
2742        /// The arguments to be bound to the function. This must have exactly the
2743        /// number of arguments specified in the function definition, and the
2744        /// argument types must also match exactly:
2745        ///
2746        ///   - Value arguments must be bound using FunctionArgument.value, and
2747        ///     the expression in that must yield a value of a type that a function
2748        ///     overload is defined for.
2749        ///   - Type arguments must be bound using FunctionArgument.type, and a
2750        ///     function overload must be defined for that type.
2751        ///   - Enum arguments must be bound using FunctionArgument.enum
2752        ///     followed by Enum.specified, with a string that case-insensitively
2753        ///     matches one of the allowed options.
2754        #[prost(message, repeated, tag = "9")]
2755        pub arguments: ::prost::alloc::vec::Vec<super::FunctionArgument>,
2756        /// Options to specify behavior for corner cases, or leave behavior
2757        /// unspecified if the consumer does not need specific behavior in these
2758        /// cases.
2759        #[prost(message, repeated, tag = "11")]
2760        pub options: ::prost::alloc::vec::Vec<super::FunctionOption>,
2761        /// Must be set to the return type of the function, exactly as derived
2762        /// using the declaration in the extension.
2763        #[prost(message, optional, tag = "7")]
2764        pub output_type: ::core::option::Option<super::Type>,
2765        /// Describes which part of the window function to perform within the
2766        /// context of distributed algorithms. Required. Must be set to
2767        /// INITIAL_TO_RESULT for window functions that are not decomposable.
2768        #[prost(enumeration = "super::AggregationPhase", tag = "6")]
2769        pub phase: i32,
2770        /// If specified, the records that are part of the window defined by
2771        /// upper_bound and lower_bound are ordered according to this list
2772        /// before they are aggregated. The first sort field has the highest
2773        /// priority; only if a sort field determines two records to be equivalent
2774        /// is the next field queried. This field is optional, and is only allowed
2775        /// if the window function is defined to support sorting.
2776        #[prost(message, repeated, tag = "3")]
2777        pub sorts: ::prost::alloc::vec::Vec<super::SortField>,
2778        /// Specifies whether equivalent records are merged before being aggregated.
2779        /// Optional, defaults to AGGREGATION_INVOCATION_ALL.
2780        #[prost(
2781            enumeration = "super::aggregate_function::AggregationInvocation",
2782            tag = "10"
2783        )]
2784        pub invocation: i32,
2785        /// When one or more partition expressions are specified, two records are
2786        /// considered to be in the same partition if and only if these expressions
2787        /// yield an equal record of values for both. When computing the window
2788        /// function, only the subset of records within the bounds that are also in
2789        /// the same partition as the current record are aggregated.
2790        #[prost(message, repeated, tag = "2")]
2791        pub partitions: ::prost::alloc::vec::Vec<super::Expression>,
2792        /// Defines the bounds type: ROWS, RANGE
2793        #[prost(enumeration = "window_function::BoundsType", tag = "12")]
2794        pub bounds_type: i32,
2795        /// Defines the record relative to the current record from which the window
2796        /// extends. The bound is inclusive. If the lower bound indexes a record
2797        /// greater than the upper bound, TODO (null range/no records passed?
2798        /// wrapping around as if lower/upper were swapped? error? null?).
2799        /// Optional; defaults to the start of the partition.
2800        #[prost(message, optional, tag = "5")]
2801        pub lower_bound: ::core::option::Option<window_function::Bound>,
2802        /// Defines the record relative to the current record up to which the window
2803        /// extends. The bound is inclusive. If the upper bound indexes a record
2804        /// less than the lower bound, TODO (null range/no records passed?
2805        /// wrapping around as if lower/upper were swapped? error? null?).
2806        /// Optional; defaults to the end of the partition.
2807        #[prost(message, optional, tag = "4")]
2808        pub upper_bound: ::core::option::Option<window_function::Bound>,
2809        /// Deprecated; use arguments instead.
2810        #[deprecated]
2811        #[prost(message, repeated, tag = "8")]
2812        pub args: ::prost::alloc::vec::Vec<super::Expression>,
2813    }
2814    /// Nested message and enum types in `WindowFunction`.
2815    pub mod window_function {
2816        /// Defines one of the two boundaries for the window of a window function.
2817        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2818        pub struct Bound {
2819            #[prost(oneof = "bound::Kind", tags = "1, 2, 3, 4")]
2820            pub kind: ::core::option::Option<bound::Kind>,
2821        }
2822        /// Nested message and enum types in `Bound`.
2823        pub mod bound {
2824            /// Defines that the bound extends this far back from the current record.
2825            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2826            pub struct Preceding {
2827                /// A strictly positive integer specifying the number of records that
2828                /// the window extends back from the current record. Required. Use
2829                /// CurrentRow for offset zero and Following for negative offsets.
2830                #[prost(int64, tag = "1")]
2831                pub offset: i64,
2832            }
2833            /// Defines that the bound extends this far ahead of the current record.
2834            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2835            pub struct Following {
2836                /// A strictly positive integer specifying the number of records that
2837                /// the window extends ahead of the current record. Required. Use
2838                /// CurrentRow for offset zero and Preceding for negative offsets.
2839                #[prost(int64, tag = "1")]
2840                pub offset: i64,
2841            }
2842            /// Defines that the bound extends to or from the current record.
2843            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2844            pub struct CurrentRow {}
2845            /// Defines an "unbounded bound": for lower bounds this means the start
2846            /// of the partition, and for upper bounds this means the end of the
2847            /// partition.
2848            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2849            pub struct Unbounded {}
2850            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
2851            pub enum Kind {
2852                /// The bound extends some number of records behind the current record.
2853                #[prost(message, tag = "1")]
2854                Preceding(Preceding),
2855                /// The bound extends some number of records ahead of the current
2856                /// record.
2857                #[prost(message, tag = "2")]
2858                Following(Following),
2859                /// The bound extends to the current record.
2860                #[prost(message, tag = "3")]
2861                CurrentRow(CurrentRow),
2862                /// The bound extends to the start of the partition or the end of the
2863                /// partition, depending on whether this represents the upper or lower
2864                /// bound.
2865                #[prost(message, tag = "4")]
2866                Unbounded(Unbounded),
2867            }
2868        }
2869        #[derive(
2870            Clone,
2871            Copy,
2872            Debug,
2873            PartialEq,
2874            Eq,
2875            Hash,
2876            PartialOrd,
2877            Ord,
2878            ::prost::Enumeration
2879        )]
2880        #[repr(i32)]
2881        pub enum BoundsType {
2882            Unspecified = 0,
2883            /// The lower and upper bound specify how many rows before and after the current row
2884            /// the window should extend.
2885            Rows = 1,
2886            /// The lower and upper bound describe a range of values.  The window should include all rows
2887            /// where the value of the ordering column is greater than or equal to (current_value - lower bound)
2888            /// and less than or equal to (current_value + upper bound).  This bounds type is only valid if there
2889            /// is a single ordering column.
2890            Range = 2,
2891        }
2892        impl BoundsType {
2893            /// String value of the enum field names used in the ProtoBuf definition.
2894            ///
2895            /// The values are not transformed in any way and thus are considered stable
2896            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2897            pub fn as_str_name(&self) -> &'static str {
2898                match self {
2899                    Self::Unspecified => "BOUNDS_TYPE_UNSPECIFIED",
2900                    Self::Rows => "BOUNDS_TYPE_ROWS",
2901                    Self::Range => "BOUNDS_TYPE_RANGE",
2902                }
2903            }
2904            /// Creates an enum from field names used in the ProtoBuf definition.
2905            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2906                match value {
2907                    "BOUNDS_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
2908                    "BOUNDS_TYPE_ROWS" => Some(Self::Rows),
2909                    "BOUNDS_TYPE_RANGE" => Some(Self::Range),
2910                    _ => None,
2911                }
2912            }
2913        }
2914    }
2915    #[derive(Clone, PartialEq, ::prost::Message)]
2916    pub struct IfThen {
2917        /// A list of one or more IfClauses
2918        #[prost(message, repeated, tag = "1")]
2919        pub ifs: ::prost::alloc::vec::Vec<if_then::IfClause>,
2920        /// The returned Expression if no IfClauses are satisified
2921        #[prost(message, optional, boxed, tag = "2")]
2922        pub r#else: ::core::option::Option<
2923            ::prost::alloc::boxed::Box<super::Expression>,
2924        >,
2925    }
2926    /// Nested message and enum types in `IfThen`.
2927    pub mod if_then {
2928        #[derive(Clone, PartialEq, ::prost::Message)]
2929        pub struct IfClause {
2930            #[prost(message, optional, tag = "1")]
2931            pub r#if: ::core::option::Option<super::super::Expression>,
2932            #[prost(message, optional, tag = "2")]
2933            pub then: ::core::option::Option<super::super::Expression>,
2934        }
2935    }
2936    #[derive(Clone, PartialEq, ::prost::Message)]
2937    pub struct Cast {
2938        #[prost(message, optional, tag = "1")]
2939        pub r#type: ::core::option::Option<super::Type>,
2940        #[prost(message, optional, boxed, tag = "2")]
2941        pub input: ::core::option::Option<::prost::alloc::boxed::Box<super::Expression>>,
2942        #[prost(enumeration = "cast::FailureBehavior", tag = "3")]
2943        pub failure_behavior: i32,
2944    }
2945    /// Nested message and enum types in `Cast`.
2946    pub mod cast {
2947        #[derive(
2948            Clone,
2949            Copy,
2950            Debug,
2951            PartialEq,
2952            Eq,
2953            Hash,
2954            PartialOrd,
2955            Ord,
2956            ::prost::Enumeration
2957        )]
2958        #[repr(i32)]
2959        pub enum FailureBehavior {
2960            Unspecified = 0,
2961            ReturnNull = 1,
2962            ThrowException = 2,
2963        }
2964        impl FailureBehavior {
2965            /// String value of the enum field names used in the ProtoBuf definition.
2966            ///
2967            /// The values are not transformed in any way and thus are considered stable
2968            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2969            pub fn as_str_name(&self) -> &'static str {
2970                match self {
2971                    Self::Unspecified => "FAILURE_BEHAVIOR_UNSPECIFIED",
2972                    Self::ReturnNull => "FAILURE_BEHAVIOR_RETURN_NULL",
2973                    Self::ThrowException => "FAILURE_BEHAVIOR_THROW_EXCEPTION",
2974                }
2975            }
2976            /// Creates an enum from field names used in the ProtoBuf definition.
2977            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2978                match value {
2979                    "FAILURE_BEHAVIOR_UNSPECIFIED" => Some(Self::Unspecified),
2980                    "FAILURE_BEHAVIOR_RETURN_NULL" => Some(Self::ReturnNull),
2981                    "FAILURE_BEHAVIOR_THROW_EXCEPTION" => Some(Self::ThrowException),
2982                    _ => None,
2983                }
2984            }
2985        }
2986    }
2987    #[derive(Clone, PartialEq, ::prost::Message)]
2988    pub struct SwitchExpression {
2989        #[prost(message, optional, boxed, tag = "3")]
2990        pub r#match: ::core::option::Option<
2991            ::prost::alloc::boxed::Box<super::Expression>,
2992        >,
2993        #[prost(message, repeated, tag = "1")]
2994        pub ifs: ::prost::alloc::vec::Vec<switch_expression::IfValue>,
2995        #[prost(message, optional, boxed, tag = "2")]
2996        pub r#else: ::core::option::Option<
2997            ::prost::alloc::boxed::Box<super::Expression>,
2998        >,
2999    }
3000    /// Nested message and enum types in `SwitchExpression`.
3001    pub mod switch_expression {
3002        #[derive(Clone, PartialEq, ::prost::Message)]
3003        pub struct IfValue {
3004            #[prost(message, optional, tag = "1")]
3005            pub r#if: ::core::option::Option<super::Literal>,
3006            #[prost(message, optional, tag = "2")]
3007            pub then: ::core::option::Option<super::super::Expression>,
3008        }
3009    }
3010    #[derive(Clone, PartialEq, ::prost::Message)]
3011    pub struct SingularOrList {
3012        #[prost(message, optional, boxed, tag = "1")]
3013        pub value: ::core::option::Option<::prost::alloc::boxed::Box<super::Expression>>,
3014        #[prost(message, repeated, tag = "2")]
3015        pub options: ::prost::alloc::vec::Vec<super::Expression>,
3016    }
3017    #[derive(Clone, PartialEq, ::prost::Message)]
3018    pub struct MultiOrList {
3019        #[prost(message, repeated, tag = "1")]
3020        pub value: ::prost::alloc::vec::Vec<super::Expression>,
3021        #[prost(message, repeated, tag = "2")]
3022        pub options: ::prost::alloc::vec::Vec<multi_or_list::Record>,
3023    }
3024    /// Nested message and enum types in `MultiOrList`.
3025    pub mod multi_or_list {
3026        #[derive(Clone, PartialEq, ::prost::Message)]
3027        pub struct Record {
3028            #[prost(message, repeated, tag = "1")]
3029            pub fields: ::prost::alloc::vec::Vec<super::super::Expression>,
3030        }
3031    }
3032    #[derive(Clone, PartialEq, ::prost::Message)]
3033    pub struct EmbeddedFunction {
3034        #[prost(message, repeated, tag = "1")]
3035        pub arguments: ::prost::alloc::vec::Vec<super::Expression>,
3036        #[prost(message, optional, tag = "2")]
3037        pub output_type: ::core::option::Option<super::Type>,
3038        #[prost(oneof = "embedded_function::Kind", tags = "3, 4")]
3039        pub kind: ::core::option::Option<embedded_function::Kind>,
3040    }
3041    /// Nested message and enum types in `EmbeddedFunction`.
3042    pub mod embedded_function {
3043        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3044        pub struct PythonPickleFunction {
3045            #[prost(bytes = "vec", tag = "1")]
3046            pub function: ::prost::alloc::vec::Vec<u8>,
3047            #[prost(string, repeated, tag = "2")]
3048            pub prerequisite: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3049        }
3050        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3051        pub struct WebAssemblyFunction {
3052            #[prost(bytes = "vec", tag = "1")]
3053            pub script: ::prost::alloc::vec::Vec<u8>,
3054            #[prost(string, repeated, tag = "2")]
3055            pub prerequisite: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3056        }
3057        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
3058        pub enum Kind {
3059            #[prost(message, tag = "3")]
3060            PythonPickleFunction(PythonPickleFunction),
3061            #[prost(message, tag = "4")]
3062            WebAssemblyFunction(WebAssemblyFunction),
3063        }
3064    }
3065    /// A way to reference the inner property of a complex record. Can reference
3066    /// either a map key by literal, a struct field by the ordinal position of
3067    /// the desired field or a particular element in an array. Supports
3068    /// expressions that would roughly translate to something similar to:
3069    /// a.b\[2\].c\['my_map_key'\].x where a,b,c and x are struct field references
3070    /// (ordinalized in the internal representation here), \[2\] is a list offset
3071    /// and \['my_map_key'\] is a reference into a map field.
3072    #[derive(Clone, PartialEq, ::prost::Message)]
3073    pub struct ReferenceSegment {
3074        #[prost(oneof = "reference_segment::ReferenceType", tags = "1, 2, 3")]
3075        pub reference_type: ::core::option::Option<reference_segment::ReferenceType>,
3076    }
3077    /// Nested message and enum types in `ReferenceSegment`.
3078    pub mod reference_segment {
3079        #[derive(Clone, PartialEq, ::prost::Message)]
3080        pub struct MapKey {
3081            /// literal based reference to specific possible value in map.
3082            #[prost(message, optional, tag = "1")]
3083            pub map_key: ::core::option::Option<super::Literal>,
3084            /// Optional child segment
3085            #[prost(message, optional, boxed, tag = "2")]
3086            pub child: ::core::option::Option<
3087                ::prost::alloc::boxed::Box<super::ReferenceSegment>,
3088            >,
3089        }
3090        #[derive(Clone, PartialEq, ::prost::Message)]
3091        pub struct StructField {
3092            /// zero-indexed ordinal position of field in struct
3093            #[prost(int32, tag = "1")]
3094            pub field: i32,
3095            /// Optional child segment
3096            #[prost(message, optional, boxed, tag = "2")]
3097            pub child: ::core::option::Option<
3098                ::prost::alloc::boxed::Box<super::ReferenceSegment>,
3099            >,
3100        }
3101        #[derive(Clone, PartialEq, ::prost::Message)]
3102        pub struct ListElement {
3103            /// zero-indexed ordinal position of element in list
3104            #[prost(int32, tag = "1")]
3105            pub offset: i32,
3106            /// Optional child segment
3107            #[prost(message, optional, boxed, tag = "2")]
3108            pub child: ::core::option::Option<
3109                ::prost::alloc::boxed::Box<super::ReferenceSegment>,
3110            >,
3111        }
3112        #[derive(Clone, PartialEq, ::prost::Oneof)]
3113        pub enum ReferenceType {
3114            #[prost(message, tag = "1")]
3115            MapKey(::prost::alloc::boxed::Box<MapKey>),
3116            #[prost(message, tag = "2")]
3117            StructField(::prost::alloc::boxed::Box<StructField>),
3118            #[prost(message, tag = "3")]
3119            ListElement(::prost::alloc::boxed::Box<ListElement>),
3120        }
3121    }
3122    /// A reference that takes an existing subtype and selectively removes fields
3123    /// from it. For example, one might initially have an inner struct with 100
3124    /// fields but a a particular operation only needs to interact with only 2 of
3125    /// those 100 fields. In this situation, one would use a mask expression to
3126    /// eliminate the 98 fields that are not relevant to the rest of the operation
3127    /// pipeline.
3128    ///
3129    /// Note that this does not fundamentally alter the structure of data beyond
3130    /// the elimination of unnecessary elements.
3131    #[derive(Clone, PartialEq, ::prost::Message)]
3132    pub struct MaskExpression {
3133        #[prost(message, optional, tag = "1")]
3134        pub select: ::core::option::Option<mask_expression::StructSelect>,
3135        #[prost(bool, tag = "2")]
3136        pub maintain_singular_struct: bool,
3137    }
3138    /// Nested message and enum types in `MaskExpression`.
3139    pub mod mask_expression {
3140        #[derive(Clone, PartialEq, ::prost::Message)]
3141        pub struct Select {
3142            #[prost(oneof = "select::Type", tags = "1, 2, 3")]
3143            pub r#type: ::core::option::Option<select::Type>,
3144        }
3145        /// Nested message and enum types in `Select`.
3146        pub mod select {
3147            #[derive(Clone, PartialEq, ::prost::Oneof)]
3148            pub enum Type {
3149                #[prost(message, tag = "1")]
3150                Struct(super::StructSelect),
3151                #[prost(message, tag = "2")]
3152                List(::prost::alloc::boxed::Box<super::ListSelect>),
3153                #[prost(message, tag = "3")]
3154                Map(::prost::alloc::boxed::Box<super::MapSelect>),
3155            }
3156        }
3157        #[derive(Clone, PartialEq, ::prost::Message)]
3158        pub struct StructSelect {
3159            #[prost(message, repeated, tag = "1")]
3160            pub struct_items: ::prost::alloc::vec::Vec<StructItem>,
3161        }
3162        #[derive(Clone, PartialEq, ::prost::Message)]
3163        pub struct StructItem {
3164            #[prost(int32, tag = "1")]
3165            pub field: i32,
3166            #[prost(message, optional, tag = "2")]
3167            pub child: ::core::option::Option<Select>,
3168        }
3169        #[derive(Clone, PartialEq, ::prost::Message)]
3170        pub struct ListSelect {
3171            #[prost(message, repeated, tag = "1")]
3172            pub selection: ::prost::alloc::vec::Vec<list_select::ListSelectItem>,
3173            #[prost(message, optional, boxed, tag = "2")]
3174            pub child: ::core::option::Option<::prost::alloc::boxed::Box<Select>>,
3175        }
3176        /// Nested message and enum types in `ListSelect`.
3177        pub mod list_select {
3178            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3179            pub struct ListSelectItem {
3180                #[prost(oneof = "list_select_item::Type", tags = "1, 2")]
3181                pub r#type: ::core::option::Option<list_select_item::Type>,
3182            }
3183            /// Nested message and enum types in `ListSelectItem`.
3184            pub mod list_select_item {
3185                #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3186                pub struct ListElement {
3187                    #[prost(int32, tag = "1")]
3188                    pub field: i32,
3189                }
3190                #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3191                pub struct ListSlice {
3192                    #[prost(int32, tag = "1")]
3193                    pub start: i32,
3194                    #[prost(int32, tag = "2")]
3195                    pub end: i32,
3196                }
3197                #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
3198                pub enum Type {
3199                    #[prost(message, tag = "1")]
3200                    Item(ListElement),
3201                    #[prost(message, tag = "2")]
3202                    Slice(ListSlice),
3203                }
3204            }
3205        }
3206        #[derive(Clone, PartialEq, ::prost::Message)]
3207        pub struct MapSelect {
3208            #[prost(message, optional, boxed, tag = "3")]
3209            pub child: ::core::option::Option<::prost::alloc::boxed::Box<Select>>,
3210            #[prost(oneof = "map_select::Select", tags = "1, 2")]
3211            pub select: ::core::option::Option<map_select::Select>,
3212        }
3213        /// Nested message and enum types in `MapSelect`.
3214        pub mod map_select {
3215            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3216            pub struct MapKey {
3217                #[prost(string, tag = "1")]
3218                pub map_key: ::prost::alloc::string::String,
3219            }
3220            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3221            pub struct MapKeyExpression {
3222                #[prost(string, tag = "1")]
3223                pub map_key_expression: ::prost::alloc::string::String,
3224            }
3225            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
3226            pub enum Select {
3227                #[prost(message, tag = "1")]
3228                Key(MapKey),
3229                #[prost(message, tag = "2")]
3230                Expression(MapKeyExpression),
3231            }
3232        }
3233    }
3234    /// A reference to data within a structured object, supporting navigation into
3235    /// nested fields. The root_type specifies the origin of the data (input record,
3236    /// outer query, lambda parameters, or an arbitrary expression), and the
3237    /// reference_type specifies how to navigate from that root (either a direct
3238    /// path to a single element or a mask selecting multiple elements).
3239    #[derive(Clone, PartialEq, ::prost::Message)]
3240    pub struct FieldReference {
3241        /// Whether this is composed of a single element reference or a masked
3242        /// element subtree
3243        #[prost(oneof = "field_reference::ReferenceType", tags = "1, 2")]
3244        pub reference_type: ::core::option::Option<field_reference::ReferenceType>,
3245        /// The origin of the data being referenced. When this is a RootReference and
3246        /// direct_reference above is used, the direct_reference must be of a type
3247        /// StructField.
3248        #[prost(oneof = "field_reference::RootType", tags = "3, 4, 5, 6")]
3249        pub root_type: ::core::option::Option<field_reference::RootType>,
3250    }
3251    /// Nested message and enum types in `FieldReference`.
3252    pub mod field_reference {
3253        /// Singleton that expresses this FieldReference is rooted off the root
3254        /// incoming record type
3255        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3256        pub struct RootReference {}
3257        /// A root reference for the outer relation's subquery
3258        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3259        pub struct OuterReference {
3260            /// number of subquery boundaries to traverse up for this field's reference
3261            ///
3262            /// This value must be >= 1
3263            #[prost(uint32, tag = "1")]
3264            pub steps_out: u32,
3265        }
3266        /// A reference to a lambda parameter within a lambda body expression.
3267        /// This identifies which lambda scope to reference, treating its parameters
3268        /// as a struct. Use FieldReference with this as root_type to access specific
3269        /// parameters or nested fields within parameters.
3270        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3271        pub struct LambdaParameterReference {
3272            /// Number of lambda boundaries to traverse up for this reference.
3273            /// For nested lambdas:
3274            ///    0 = innermost lambda (current lambda's parameters as a struct)
3275            ///    1 = one lambda level out (outer lambda's parameters as a struct)
3276            ///    2 = two lambda levels out, etc.
3277            #[prost(uint32, tag = "1")]
3278            pub steps_out: u32,
3279        }
3280        /// Whether this is composed of a single element reference or a masked
3281        /// element subtree
3282        #[derive(Clone, PartialEq, ::prost::Oneof)]
3283        pub enum ReferenceType {
3284            #[prost(message, tag = "1")]
3285            DirectReference(super::ReferenceSegment),
3286            #[prost(message, tag = "2")]
3287            MaskedReference(super::MaskExpression),
3288        }
3289        /// The origin of the data being referenced. When this is a RootReference and
3290        /// direct_reference above is used, the direct_reference must be of a type
3291        /// StructField.
3292        #[derive(Clone, PartialEq, ::prost::Oneof)]
3293        pub enum RootType {
3294            #[prost(message, tag = "3")]
3295            Expression(::prost::alloc::boxed::Box<super::super::Expression>),
3296            #[prost(message, tag = "4")]
3297            RootReference(RootReference),
3298            #[prost(message, tag = "5")]
3299            OuterReference(OuterReference),
3300            #[prost(message, tag = "6")]
3301            LambdaParameterReference(LambdaParameterReference),
3302        }
3303    }
3304    /// Subquery relation expression
3305    #[derive(Clone, PartialEq, ::prost::Message)]
3306    pub struct Subquery {
3307        #[prost(oneof = "subquery::SubqueryType", tags = "1, 2, 3, 4")]
3308        pub subquery_type: ::core::option::Option<subquery::SubqueryType>,
3309    }
3310    /// Nested message and enum types in `Subquery`.
3311    pub mod subquery {
3312        /// A subquery with one row and one column. This is often an aggregate
3313        /// though not required to be.
3314        #[derive(Clone, PartialEq, ::prost::Message)]
3315        pub struct Scalar {
3316            #[prost(message, optional, boxed, tag = "1")]
3317            pub input: ::core::option::Option<
3318                ::prost::alloc::boxed::Box<super::super::Rel>,
3319            >,
3320        }
3321        /// Predicate checking that the left expression is contained in the right
3322        /// subquery
3323        ///
3324        /// Examples:
3325        ///
3326        /// x IN (SELECT * FROM t)
3327        /// (x, y) IN (SELECT a, b FROM t)
3328        #[derive(Clone, PartialEq, ::prost::Message)]
3329        pub struct InPredicate {
3330            #[prost(message, repeated, tag = "1")]
3331            pub needles: ::prost::alloc::vec::Vec<super::super::Expression>,
3332            #[prost(message, optional, boxed, tag = "2")]
3333            pub haystack: ::core::option::Option<
3334                ::prost::alloc::boxed::Box<super::super::Rel>,
3335            >,
3336        }
3337        /// A predicate over a set of rows in the form of a subquery
3338        /// EXISTS and UNIQUE are common SQL forms of this operation.
3339        #[derive(Clone, PartialEq, ::prost::Message)]
3340        pub struct SetPredicate {
3341            /// TODO: should allow expressions
3342            #[prost(enumeration = "set_predicate::PredicateOp", tag = "1")]
3343            pub predicate_op: i32,
3344            #[prost(message, optional, boxed, tag = "2")]
3345            pub tuples: ::core::option::Option<
3346                ::prost::alloc::boxed::Box<super::super::Rel>,
3347            >,
3348        }
3349        /// Nested message and enum types in `SetPredicate`.
3350        pub mod set_predicate {
3351            #[derive(
3352                Clone,
3353                Copy,
3354                Debug,
3355                PartialEq,
3356                Eq,
3357                Hash,
3358                PartialOrd,
3359                Ord,
3360                ::prost::Enumeration
3361            )]
3362            #[repr(i32)]
3363            pub enum PredicateOp {
3364                Unspecified = 0,
3365                Exists = 1,
3366                Unique = 2,
3367            }
3368            impl PredicateOp {
3369                /// String value of the enum field names used in the ProtoBuf definition.
3370                ///
3371                /// The values are not transformed in any way and thus are considered stable
3372                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3373                pub fn as_str_name(&self) -> &'static str {
3374                    match self {
3375                        Self::Unspecified => "PREDICATE_OP_UNSPECIFIED",
3376                        Self::Exists => "PREDICATE_OP_EXISTS",
3377                        Self::Unique => "PREDICATE_OP_UNIQUE",
3378                    }
3379                }
3380                /// Creates an enum from field names used in the ProtoBuf definition.
3381                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3382                    match value {
3383                        "PREDICATE_OP_UNSPECIFIED" => Some(Self::Unspecified),
3384                        "PREDICATE_OP_EXISTS" => Some(Self::Exists),
3385                        "PREDICATE_OP_UNIQUE" => Some(Self::Unique),
3386                        _ => None,
3387                    }
3388                }
3389            }
3390        }
3391        /// A subquery comparison using ANY or ALL.
3392        /// Examples:
3393        ///
3394        /// SELECT *
3395        /// FROM t1
3396        /// WHERE x < ANY(SELECT y from t2)
3397        #[derive(Clone, PartialEq, ::prost::Message)]
3398        pub struct SetComparison {
3399            /// ANY or ALL
3400            #[prost(enumeration = "set_comparison::ReductionOp", tag = "1")]
3401            pub reduction_op: i32,
3402            /// A comparison operator
3403            #[prost(enumeration = "set_comparison::ComparisonOp", tag = "2")]
3404            pub comparison_op: i32,
3405            /// left side of the expression
3406            #[prost(message, optional, boxed, tag = "3")]
3407            pub left: ::core::option::Option<
3408                ::prost::alloc::boxed::Box<super::super::Expression>,
3409            >,
3410            /// right side of the expression
3411            #[prost(message, optional, boxed, tag = "4")]
3412            pub right: ::core::option::Option<
3413                ::prost::alloc::boxed::Box<super::super::Rel>,
3414            >,
3415        }
3416        /// Nested message and enum types in `SetComparison`.
3417        pub mod set_comparison {
3418            #[derive(
3419                Clone,
3420                Copy,
3421                Debug,
3422                PartialEq,
3423                Eq,
3424                Hash,
3425                PartialOrd,
3426                Ord,
3427                ::prost::Enumeration
3428            )]
3429            #[repr(i32)]
3430            pub enum ComparisonOp {
3431                Unspecified = 0,
3432                Eq = 1,
3433                Ne = 2,
3434                Lt = 3,
3435                Gt = 4,
3436                Le = 5,
3437                Ge = 6,
3438            }
3439            impl ComparisonOp {
3440                /// String value of the enum field names used in the ProtoBuf definition.
3441                ///
3442                /// The values are not transformed in any way and thus are considered stable
3443                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3444                pub fn as_str_name(&self) -> &'static str {
3445                    match self {
3446                        Self::Unspecified => "COMPARISON_OP_UNSPECIFIED",
3447                        Self::Eq => "COMPARISON_OP_EQ",
3448                        Self::Ne => "COMPARISON_OP_NE",
3449                        Self::Lt => "COMPARISON_OP_LT",
3450                        Self::Gt => "COMPARISON_OP_GT",
3451                        Self::Le => "COMPARISON_OP_LE",
3452                        Self::Ge => "COMPARISON_OP_GE",
3453                    }
3454                }
3455                /// Creates an enum from field names used in the ProtoBuf definition.
3456                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3457                    match value {
3458                        "COMPARISON_OP_UNSPECIFIED" => Some(Self::Unspecified),
3459                        "COMPARISON_OP_EQ" => Some(Self::Eq),
3460                        "COMPARISON_OP_NE" => Some(Self::Ne),
3461                        "COMPARISON_OP_LT" => Some(Self::Lt),
3462                        "COMPARISON_OP_GT" => Some(Self::Gt),
3463                        "COMPARISON_OP_LE" => Some(Self::Le),
3464                        "COMPARISON_OP_GE" => Some(Self::Ge),
3465                        _ => None,
3466                    }
3467                }
3468            }
3469            #[derive(
3470                Clone,
3471                Copy,
3472                Debug,
3473                PartialEq,
3474                Eq,
3475                Hash,
3476                PartialOrd,
3477                Ord,
3478                ::prost::Enumeration
3479            )]
3480            #[repr(i32)]
3481            pub enum ReductionOp {
3482                Unspecified = 0,
3483                Any = 1,
3484                All = 2,
3485            }
3486            impl ReductionOp {
3487                /// String value of the enum field names used in the ProtoBuf definition.
3488                ///
3489                /// The values are not transformed in any way and thus are considered stable
3490                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3491                pub fn as_str_name(&self) -> &'static str {
3492                    match self {
3493                        Self::Unspecified => "REDUCTION_OP_UNSPECIFIED",
3494                        Self::Any => "REDUCTION_OP_ANY",
3495                        Self::All => "REDUCTION_OP_ALL",
3496                    }
3497                }
3498                /// Creates an enum from field names used in the ProtoBuf definition.
3499                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3500                    match value {
3501                        "REDUCTION_OP_UNSPECIFIED" => Some(Self::Unspecified),
3502                        "REDUCTION_OP_ANY" => Some(Self::Any),
3503                        "REDUCTION_OP_ALL" => Some(Self::All),
3504                        _ => None,
3505                    }
3506                }
3507            }
3508        }
3509        #[derive(Clone, PartialEq, ::prost::Oneof)]
3510        pub enum SubqueryType {
3511            /// Scalar subquery
3512            #[prost(message, tag = "1")]
3513            Scalar(::prost::alloc::boxed::Box<Scalar>),
3514            /// x IN y predicate
3515            #[prost(message, tag = "2")]
3516            InPredicate(::prost::alloc::boxed::Box<InPredicate>),
3517            /// EXISTS/UNIQUE predicate
3518            #[prost(message, tag = "3")]
3519            SetPredicate(::prost::alloc::boxed::Box<SetPredicate>),
3520            /// ANY/ALL predicate
3521            #[prost(message, tag = "4")]
3522            SetComparison(::prost::alloc::boxed::Box<SetComparison>),
3523        }
3524    }
3525    #[derive(Clone, PartialEq, ::prost::Oneof)]
3526    pub enum RexType {
3527        #[prost(message, tag = "1")]
3528        Literal(Literal),
3529        #[prost(message, tag = "2")]
3530        Selection(::prost::alloc::boxed::Box<FieldReference>),
3531        #[prost(message, tag = "3")]
3532        ScalarFunction(ScalarFunction),
3533        #[prost(message, tag = "5")]
3534        WindowFunction(WindowFunction),
3535        #[prost(message, tag = "6")]
3536        IfThen(::prost::alloc::boxed::Box<IfThen>),
3537        #[prost(message, tag = "7")]
3538        SwitchExpression(::prost::alloc::boxed::Box<SwitchExpression>),
3539        #[prost(message, tag = "8")]
3540        SingularOrList(::prost::alloc::boxed::Box<SingularOrList>),
3541        #[prost(message, tag = "9")]
3542        MultiOrList(MultiOrList),
3543        #[prost(message, tag = "11")]
3544        Cast(::prost::alloc::boxed::Box<Cast>),
3545        #[prost(message, tag = "12")]
3546        Subquery(::prost::alloc::boxed::Box<Subquery>),
3547        #[prost(message, tag = "13")]
3548        Nested(Nested),
3549        #[prost(message, tag = "14")]
3550        DynamicParameter(super::DynamicParameter),
3551        #[prost(message, tag = "15")]
3552        Lambda(::prost::alloc::boxed::Box<Lambda>),
3553        #[prost(message, tag = "16")]
3554        LambdaInvocation(::prost::alloc::boxed::Box<LambdaInvocation>),
3555        /// deprecated: enum literals are only sensible in the context of
3556        /// function arguments, for which FunctionArgument should now be
3557        /// used
3558        #[prost(message, tag = "10")]
3559        Enum(Enum),
3560    }
3561}
3562/// Expression that represents a dynamic parameter.
3563/// Dynamic parameters are identified by a surrogate key within a plan.
3564#[derive(Clone, PartialEq, ::prost::Message)]
3565pub struct DynamicParameter {
3566    /// The type of the dynamic parameter.
3567    #[prost(message, optional, tag = "1")]
3568    pub r#type: ::core::option::Option<Type>,
3569    /// The surrogate key used within a plan to reference a specific parameter binding.
3570    /// 0 is a valid anchor/reference, but prefer non-zero values for ergonomics.
3571    #[prost(uint32, tag = "2")]
3572    pub parameter_reference: u32,
3573}
3574/// The description of a field to sort on (including the direction of sorting and null semantics)
3575#[derive(Clone, PartialEq, ::prost::Message)]
3576pub struct SortField {
3577    #[prost(message, optional, tag = "1")]
3578    pub expr: ::core::option::Option<Expression>,
3579    #[prost(oneof = "sort_field::SortKind", tags = "2, 3")]
3580    pub sort_kind: ::core::option::Option<sort_field::SortKind>,
3581}
3582/// Nested message and enum types in `SortField`.
3583pub mod sort_field {
3584    #[derive(
3585        Clone,
3586        Copy,
3587        Debug,
3588        PartialEq,
3589        Eq,
3590        Hash,
3591        PartialOrd,
3592        Ord,
3593        ::prost::Enumeration
3594    )]
3595    #[repr(i32)]
3596    pub enum SortDirection {
3597        Unspecified = 0,
3598        AscNullsFirst = 1,
3599        AscNullsLast = 2,
3600        DescNullsFirst = 3,
3601        DescNullsLast = 4,
3602        Clustered = 5,
3603    }
3604    impl SortDirection {
3605        /// String value of the enum field names used in the ProtoBuf definition.
3606        ///
3607        /// The values are not transformed in any way and thus are considered stable
3608        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3609        pub fn as_str_name(&self) -> &'static str {
3610            match self {
3611                Self::Unspecified => "SORT_DIRECTION_UNSPECIFIED",
3612                Self::AscNullsFirst => "SORT_DIRECTION_ASC_NULLS_FIRST",
3613                Self::AscNullsLast => "SORT_DIRECTION_ASC_NULLS_LAST",
3614                Self::DescNullsFirst => "SORT_DIRECTION_DESC_NULLS_FIRST",
3615                Self::DescNullsLast => "SORT_DIRECTION_DESC_NULLS_LAST",
3616                Self::Clustered => "SORT_DIRECTION_CLUSTERED",
3617            }
3618        }
3619        /// Creates an enum from field names used in the ProtoBuf definition.
3620        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3621            match value {
3622                "SORT_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
3623                "SORT_DIRECTION_ASC_NULLS_FIRST" => Some(Self::AscNullsFirst),
3624                "SORT_DIRECTION_ASC_NULLS_LAST" => Some(Self::AscNullsLast),
3625                "SORT_DIRECTION_DESC_NULLS_FIRST" => Some(Self::DescNullsFirst),
3626                "SORT_DIRECTION_DESC_NULLS_LAST" => Some(Self::DescNullsLast),
3627                "SORT_DIRECTION_CLUSTERED" => Some(Self::Clustered),
3628                _ => None,
3629            }
3630        }
3631    }
3632    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
3633    pub enum SortKind {
3634        #[prost(enumeration = "SortDirection", tag = "2")]
3635        Direction(i32),
3636        /// References a function_anchor defined in this plan.
3637        #[prost(uint32, tag = "3")]
3638        ComparisonFunctionReference(u32),
3639    }
3640}
3641/// An aggregate function.
3642#[derive(Clone, PartialEq, ::prost::Message)]
3643pub struct AggregateFunction {
3644    /// Points to a function_anchor defined in this plan, which must refer
3645    /// to an aggregate function in the associated YAML file. Required.
3646    #[prost(uint32, tag = "1")]
3647    pub function_reference: u32,
3648    /// The arguments to be bound to the function. This must have exactly the
3649    /// number of arguments specified in the function definition, and the
3650    /// argument types must also match exactly:
3651    ///
3652    ///   - Value arguments must be bound using FunctionArgument.value, and
3653    ///     the expression in that must yield a value of a type that a function
3654    ///     overload is defined for.
3655    ///   - Type arguments must be bound using FunctionArgument.type, and a
3656    ///     function overload must be defined for that type.
3657    ///   - Enum arguments must be bound using FunctionArgument.enum
3658    ///     followed by Enum.specified, with a string that case-insensitively
3659    ///     matches one of the allowed options.
3660    ///   - Optional enum arguments must be bound using FunctionArgument.enum
3661    ///     followed by either Enum.specified or Enum.unspecified. If specified,
3662    ///     the string must case-insensitively match one of the allowed options.
3663    #[prost(message, repeated, tag = "7")]
3664    pub arguments: ::prost::alloc::vec::Vec<FunctionArgument>,
3665    /// Options to specify behavior for corner cases, or leave behavior
3666    /// unspecified if the consumer does not need specific behavior in these
3667    /// cases.
3668    #[prost(message, repeated, tag = "8")]
3669    pub options: ::prost::alloc::vec::Vec<FunctionOption>,
3670    /// Must be set to the return type of the function, exactly as derived
3671    /// using the declaration in the extension.
3672    #[prost(message, optional, tag = "5")]
3673    pub output_type: ::core::option::Option<Type>,
3674    /// Describes which part of the aggregation to perform within the context of
3675    /// distributed algorithms. Required. Must be set to INITIAL_TO_RESULT for
3676    /// aggregate functions that are not decomposable.
3677    #[prost(enumeration = "AggregationPhase", tag = "4")]
3678    pub phase: i32,
3679    /// If specified, the aggregated records are ordered according to this list
3680    /// before they are aggregated. The first sort field has the highest
3681    /// priority; only if a sort field determines two records to be equivalent is
3682    /// the next field queried. This field is optional.
3683    #[prost(message, repeated, tag = "3")]
3684    pub sorts: ::prost::alloc::vec::Vec<SortField>,
3685    /// Specifies whether equivalent records are merged before being aggregated.
3686    /// Optional, defaults to AGGREGATION_INVOCATION_ALL.
3687    #[prost(enumeration = "aggregate_function::AggregationInvocation", tag = "6")]
3688    pub invocation: i32,
3689    /// deprecated; use arguments instead
3690    #[deprecated]
3691    #[prost(message, repeated, tag = "2")]
3692    pub args: ::prost::alloc::vec::Vec<Expression>,
3693}
3694/// Nested message and enum types in `AggregateFunction`.
3695pub mod aggregate_function {
3696    /// Method in which equivalent records are merged before being aggregated.
3697    #[derive(
3698        Clone,
3699        Copy,
3700        Debug,
3701        PartialEq,
3702        Eq,
3703        Hash,
3704        PartialOrd,
3705        Ord,
3706        ::prost::Enumeration
3707    )]
3708    #[repr(i32)]
3709    pub enum AggregationInvocation {
3710        /// This default value implies AGGREGATION_INVOCATION_ALL.
3711        Unspecified = 0,
3712        /// Use all values in the aggregation calculation.
3713        All = 1,
3714        /// Use only distinct values in the aggregation calculation.
3715        Distinct = 2,
3716    }
3717    impl AggregationInvocation {
3718        /// String value of the enum field names used in the ProtoBuf definition.
3719        ///
3720        /// The values are not transformed in any way and thus are considered stable
3721        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3722        pub fn as_str_name(&self) -> &'static str {
3723            match self {
3724                Self::Unspecified => "AGGREGATION_INVOCATION_UNSPECIFIED",
3725                Self::All => "AGGREGATION_INVOCATION_ALL",
3726                Self::Distinct => "AGGREGATION_INVOCATION_DISTINCT",
3727            }
3728        }
3729        /// Creates an enum from field names used in the ProtoBuf definition.
3730        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3731            match value {
3732                "AGGREGATION_INVOCATION_UNSPECIFIED" => Some(Self::Unspecified),
3733                "AGGREGATION_INVOCATION_ALL" => Some(Self::All),
3734                "AGGREGATION_INVOCATION_DISTINCT" => Some(Self::Distinct),
3735                _ => None,
3736            }
3737        }
3738    }
3739}
3740/// This rel is used  to create references,
3741/// in case we refer to a RelRoot field names will be ignored
3742#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3743pub struct ReferenceRel {
3744    #[prost(int32, tag = "1")]
3745    pub subtree_ordinal: i32,
3746}
3747/// Describes which part of an aggregation or window function to perform within
3748/// the context of distributed algorithms.
3749#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3750#[repr(i32)]
3751pub enum AggregationPhase {
3752    /// Implies `INTERMEDIATE_TO_RESULT`.
3753    Unspecified = 0,
3754    /// Specifies that the function should be run only up to the point of
3755    /// generating an intermediate value, to be further aggregated later using
3756    /// INTERMEDIATE_TO_INTERMEDIATE or INTERMEDIATE_TO_RESULT.
3757    InitialToIntermediate = 1,
3758    /// Specifies that the inputs of the aggregate or window function are the
3759    /// intermediate values of the function, and that the output should also be
3760    /// an intermediate value, to be further aggregated later using
3761    /// INTERMEDIATE_TO_INTERMEDIATE or INTERMEDIATE_TO_RESULT.
3762    IntermediateToIntermediate = 2,
3763    /// A complete invocation: the function should aggregate the given set of
3764    /// inputs to yield a single return value. This style must be used for
3765    /// aggregate or window functions that are not decomposable.
3766    InitialToResult = 3,
3767    /// Specifies that the inputs of the aggregate or window function are the
3768    /// intermediate values of the function, generated previously using
3769    /// INITIAL_TO_INTERMEDIATE and possibly INTERMEDIATE_TO_INTERMEDIATE calls.
3770    /// This call should combine the intermediate values to yield the final
3771    /// return value.
3772    IntermediateToResult = 4,
3773}
3774impl AggregationPhase {
3775    /// String value of the enum field names used in the ProtoBuf definition.
3776    ///
3777    /// The values are not transformed in any way and thus are considered stable
3778    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3779    pub fn as_str_name(&self) -> &'static str {
3780        match self {
3781            Self::Unspecified => "AGGREGATION_PHASE_UNSPECIFIED",
3782            Self::InitialToIntermediate => "AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE",
3783            Self::IntermediateToIntermediate => {
3784                "AGGREGATION_PHASE_INTERMEDIATE_TO_INTERMEDIATE"
3785            }
3786            Self::InitialToResult => "AGGREGATION_PHASE_INITIAL_TO_RESULT",
3787            Self::IntermediateToResult => "AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT",
3788        }
3789    }
3790    /// Creates an enum from field names used in the ProtoBuf definition.
3791    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3792        match value {
3793            "AGGREGATION_PHASE_UNSPECIFIED" => Some(Self::Unspecified),
3794            "AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE" => {
3795                Some(Self::InitialToIntermediate)
3796            }
3797            "AGGREGATION_PHASE_INTERMEDIATE_TO_INTERMEDIATE" => {
3798                Some(Self::IntermediateToIntermediate)
3799            }
3800            "AGGREGATION_PHASE_INITIAL_TO_RESULT" => Some(Self::InitialToResult),
3801            "AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT" => {
3802                Some(Self::IntermediateToResult)
3803            }
3804            _ => None,
3805        }
3806    }
3807}
3808/// Either a relation or root relation
3809#[derive(Clone, PartialEq, ::prost::Message)]
3810pub struct PlanRel {
3811    #[prost(oneof = "plan_rel::RelType", tags = "1, 2")]
3812    pub rel_type: ::core::option::Option<plan_rel::RelType>,
3813}
3814/// Nested message and enum types in `PlanRel`.
3815pub mod plan_rel {
3816    #[derive(Clone, PartialEq, ::prost::Oneof)]
3817    pub enum RelType {
3818        /// Any relation (used for references and CTEs)
3819        #[prost(message, tag = "1")]
3820        Rel(super::Rel),
3821        /// The root of a relation tree
3822        #[prost(message, tag = "2")]
3823        Root(super::RelRoot),
3824    }
3825}
3826/// Describe a set of operations to complete.
3827/// For compactness sake, identifiers are normalized at the plan level.
3828#[derive(Clone, PartialEq, ::prost::Message)]
3829pub struct Plan {
3830    /// Substrait version of the plan. Optional up to 0.17.0, required for later
3831    /// versions.
3832    #[prost(message, optional, tag = "6")]
3833    pub version: ::core::option::Option<Version>,
3834    /// a list of extension URNs this plan may depend on
3835    #[prost(message, repeated, tag = "8")]
3836    pub extension_urns: ::prost::alloc::vec::Vec<extensions::SimpleExtensionUrn>,
3837    /// a list of extensions this plan may depend on
3838    #[prost(message, repeated, tag = "2")]
3839    pub extensions: ::prost::alloc::vec::Vec<extensions::SimpleExtensionDeclaration>,
3840    /// one or more relation trees that are associated with this plan.
3841    #[prost(message, repeated, tag = "3")]
3842    pub relations: ::prost::alloc::vec::Vec<PlanRel>,
3843    /// additional extensions associated with this plan.
3844    #[prost(message, optional, tag = "4")]
3845    pub advanced_extensions: ::core::option::Option<extensions::AdvancedExtension>,
3846    /// A list of com.google.Any entities that this plan may use. Can be used to
3847    /// warn if some embedded message types are unknown. Note that this list may
3848    /// include message types that are ignorable (optimizations) or that are
3849    /// unused. In many cases, a consumer may be able to work with a plan even if
3850    /// one or more message types defined here are unknown.
3851    #[prost(string, repeated, tag = "5")]
3852    pub expected_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3853    /// An optional list of bindings for dynamic parameters used in this plan.
3854    /// Each binding maps a parameter_anchor to its corresponding runtime value.
3855    #[prost(message, repeated, tag = "7")]
3856    pub parameter_bindings: ::prost::alloc::vec::Vec<DynamicParameterBinding>,
3857    /// An optional list of type aliases. Types can be specified here once, and
3858    /// then referenced within the plan using the TypeAliasReference type. This
3859    /// feature is intended to assist with the usability of parameterized types,
3860    /// which require that all parameters be specified when they are declared.
3861    /// This can bloat plans with redundant redeclarations, especially if the
3862    /// parameterized types being declared have many parameters (e.g., struct with
3863    /// many fields, nested parameterized types, string as a type parameter).
3864    #[prost(message, repeated, tag = "9")]
3865    pub type_aliases: ::prost::alloc::vec::Vec<TypeAlias>,
3866}
3867/// This message type can be used to deserialize only the version of a Substrait
3868/// Plan message. This prevents deserialization errors when there were breaking
3869/// changes between the Substrait version of the tool that produced the plan and
3870/// the Substrait version used to deserialize it, such that a consumer can emit
3871/// a more helpful error message in this case.
3872#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3873pub struct PlanVersion {
3874    #[prost(message, optional, tag = "6")]
3875    pub version: ::core::option::Option<Version>,
3876}
3877#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3878pub struct Version {
3879    /// Substrait version number.
3880    #[prost(uint32, tag = "1")]
3881    pub major_number: u32,
3882    #[prost(uint32, tag = "2")]
3883    pub minor_number: u32,
3884    #[prost(uint32, tag = "3")]
3885    pub patch_number: u32,
3886    /// If a particular version of Substrait is used that does not correspond to
3887    /// a version number exactly (for example when using an unofficial fork or
3888    /// using a version that is not yet released or is between versions), set this
3889    /// to the full git hash of the utilized commit of
3890    /// <https://github.com/substrait-io/substrait> (or fork thereof), represented
3891    /// using a lowercase hex ASCII string 40 characters in length. The version
3892    /// number above should be set to the most recent version tag in the history
3893    /// of that commit.
3894    #[prost(string, tag = "4")]
3895    pub git_hash: ::prost::alloc::string::String,
3896    /// Identifying information for the producer that created this plan. Under
3897    /// ideal circumstances, consumers should not need this information. However,
3898    /// it is foreseen that consumers may need to work around bugs in particular
3899    /// producers in practice, and therefore may need to know which producer
3900    /// created the plan.
3901    #[prost(string, tag = "5")]
3902    pub producer: ::prost::alloc::string::String,
3903}
3904/// Represents a binding for a dynamic parameter.
3905#[derive(Clone, PartialEq, ::prost::Message)]
3906pub struct DynamicParameterBinding {
3907    /// The parameter anchor that identifies the dynamic parameter reference.
3908    /// 0 is a valid anchor/reference, but prefer non-zero values for ergonomics.
3909    #[prost(uint32, tag = "1")]
3910    pub parameter_anchor: u32,
3911    /// The literal value assigned to the parameter at runtime.
3912    /// The type of the literal needs to match the type of the corresponding
3913    /// DynamicParameter expression in the plan.
3914    #[prost(message, optional, tag = "2")]
3915    pub value: ::core::option::Option<expression::Literal>,
3916}
3917#[derive(Clone, PartialEq, ::prost::Message)]
3918pub struct ExpressionReference {
3919    /// Field names in depth-first order
3920    #[prost(string, repeated, tag = "3")]
3921    pub output_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3922    #[prost(oneof = "expression_reference::ExprType", tags = "1, 2")]
3923    pub expr_type: ::core::option::Option<expression_reference::ExprType>,
3924}
3925/// Nested message and enum types in `ExpressionReference`.
3926pub mod expression_reference {
3927    #[derive(Clone, PartialEq, ::prost::Oneof)]
3928    pub enum ExprType {
3929        #[prost(message, tag = "1")]
3930        Expression(super::Expression),
3931        #[prost(message, tag = "2")]
3932        Measure(super::AggregateFunction),
3933    }
3934}
3935/// Describe a set of operations to complete.
3936/// For compactness sake, identifiers are normalized at the plan level.
3937#[derive(Clone, PartialEq, ::prost::Message)]
3938pub struct ExtendedExpression {
3939    /// Substrait version of the expression. Optional up to 0.17.0, required for later
3940    /// versions.
3941    #[prost(message, optional, tag = "7")]
3942    pub version: ::core::option::Option<Version>,
3943    /// a list of extension specifications this expression may depend on,
3944    /// referenced by Extension URN
3945    #[prost(message, repeated, tag = "8")]
3946    pub extension_urns: ::prost::alloc::vec::Vec<extensions::SimpleExtensionUrn>,
3947    /// a list of extensions this expression may depend on
3948    #[prost(message, repeated, tag = "2")]
3949    pub extensions: ::prost::alloc::vec::Vec<extensions::SimpleExtensionDeclaration>,
3950    /// one or more expression trees with same order in plan rel
3951    #[prost(message, repeated, tag = "3")]
3952    pub referred_expr: ::prost::alloc::vec::Vec<ExpressionReference>,
3953    #[prost(message, optional, tag = "4")]
3954    pub base_schema: ::core::option::Option<NamedStruct>,
3955    /// additional extensions associated with this expression.
3956    #[prost(message, optional, tag = "5")]
3957    pub advanced_extensions: ::core::option::Option<extensions::AdvancedExtension>,
3958    /// A list of com.google.Any entities that this plan may use. Can be used to
3959    /// warn if some embedded message types are unknown. Note that this list may
3960    /// include message types that are ignorable (optimizations) or that are
3961    /// unused. In many cases, a consumer may be able to work with a plan even if
3962    /// one or more message types defined here are unknown.
3963    #[prost(string, repeated, tag = "6")]
3964    pub expected_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3965}