Skip to main content

vortex_array/proto/generated/
vortex.expr.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3//
4// @generated by `cargo run -p xtask -- generate-proto`, do not modify.
5
6// This file is @generated by prost-build.
7/// Captures a generic representation of expressions in Vortex.
8/// Expression deserializers can be registered with a Vortex session to handle parsing this into
9/// an in-memory expression for execution.
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct Expr {
12    #[prost(string, tag = "1")]
13    pub id: ::prost::alloc::string::String,
14    #[prost(message, repeated, tag = "2")]
15    pub children: ::prost::alloc::vec::Vec<Expr>,
16    #[prost(bytes = "vec", optional, tag = "3")]
17    pub metadata: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
18}
19/// Captures a serialized aggregate function with its ID and options metadata.
20#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
21pub struct AggregateFn {
22    #[prost(string, tag = "1")]
23    pub id: ::prost::alloc::string::String,
24    #[prost(bytes = "vec", optional, tag = "2")]
25    pub metadata: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
26}
27/// Options for numeric aggregate functions (`vortex.sum`, `vortex.min`, `vortex.max`),
28/// controlling how NaN values in floating-point inputs are handled.
29#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
30pub struct NumericalAggregateOpts {
31    #[prost(bool, tag = "1")]
32    pub skip_nans: bool,
33}
34/// Options for `vortex.literal`
35#[derive(Clone, PartialEq, ::prost::Message)]
36pub struct LiteralOpts {
37    #[prost(message, optional, tag = "1")]
38    pub value: ::core::option::Option<super::scalar::Scalar>,
39}
40/// Options for `vortex.pack`
41#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
42pub struct PackOpts {
43    #[prost(string, repeated, tag = "1")]
44    pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
45    #[prost(bool, tag = "2")]
46    pub nullable: bool,
47}
48/// Options for `vortex.getitem`
49#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
50pub struct GetItemOpts {
51    #[prost(string, tag = "1")]
52    pub path: ::prost::alloc::string::String,
53}
54/// Options for `vortex.variant_get`
55#[derive(Clone, PartialEq, ::prost::Message)]
56pub struct VariantGetOpts {
57    #[prost(message, repeated, tag = "1")]
58    pub path: ::prost::alloc::vec::Vec<VariantPathElement>,
59    #[prost(message, optional, tag = "2")]
60    pub dtype: ::core::option::Option<super::dtype::DType>,
61}
62#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
63pub struct VariantPathElement {
64    #[prost(oneof = "variant_path_element::Element", tags = "1, 2")]
65    pub element: ::core::option::Option<variant_path_element::Element>,
66}
67/// Nested message and enum types in `VariantPathElement`.
68pub mod variant_path_element {
69    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
70    pub enum Element {
71        #[prost(string, tag = "1")]
72        Field(::prost::alloc::string::String),
73        #[prost(uint64, tag = "2")]
74        Index(u64),
75    }
76}
77/// Options for `vortex.json_to_variant`
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct JsonToVariantOpts {
80    #[prost(message, repeated, tag = "1")]
81    pub shredding: ::prost::alloc::vec::Vec<ShreddingSpecField>,
82}
83/// One (path, dtype) shredding directive for `vortex.json_to_variant`.
84#[derive(Clone, PartialEq, ::prost::Message)]
85pub struct ShreddingSpecField {
86    #[prost(message, repeated, tag = "1")]
87    pub path: ::prost::alloc::vec::Vec<VariantPathElement>,
88    #[prost(message, optional, tag = "2")]
89    pub dtype: ::core::option::Option<super::dtype::DType>,
90}
91/// Options for `vortex.compare`
92#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
93pub struct CompareOpts {
94    #[prost(enumeration = "compare_opts::CompareOp", tag = "1")]
95    pub op: i32,
96}
97/// Nested message and enum types in `CompareOpts`.
98pub mod compare_opts {
99    #[derive(
100        Clone,
101        Copy,
102        Debug,
103        PartialEq,
104        Eq,
105        Hash,
106        PartialOrd,
107        Ord,
108        ::prost::Enumeration
109    )]
110    #[repr(i32)]
111    pub enum CompareOp {
112        Eq = 0,
113        NotEq = 1,
114        Gt = 2,
115        Gte = 3,
116        Lt = 4,
117        Lte = 5,
118    }
119    impl CompareOp {
120        /// String value of the enum field names used in the ProtoBuf definition.
121        ///
122        /// The values are not transformed in any way and thus are considered stable
123        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
124        pub fn as_str_name(&self) -> &'static str {
125            match self {
126                Self::Eq => "Eq",
127                Self::NotEq => "NotEq",
128                Self::Gt => "Gt",
129                Self::Gte => "Gte",
130                Self::Lt => "Lt",
131                Self::Lte => "Lte",
132            }
133        }
134        /// Creates an enum from field names used in the ProtoBuf definition.
135        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
136            match value {
137                "Eq" => Some(Self::Eq),
138                "NotEq" => Some(Self::NotEq),
139                "Gt" => Some(Self::Gt),
140                "Gte" => Some(Self::Gte),
141                "Lt" => Some(Self::Lt),
142                "Lte" => Some(Self::Lte),
143                _ => None,
144            }
145        }
146    }
147}
148/// Options for `vortex.boolean`
149#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
150pub struct BooleanOpts {
151    #[prost(enumeration = "boolean_opts::BooleanOp", tag = "1")]
152    pub op: i32,
153}
154/// Nested message and enum types in `BooleanOpts`.
155pub mod boolean_opts {
156    #[derive(
157        Clone,
158        Copy,
159        Debug,
160        PartialEq,
161        Eq,
162        Hash,
163        PartialOrd,
164        Ord,
165        ::prost::Enumeration
166    )]
167    #[repr(i32)]
168    pub enum BooleanOp {
169        And = 0,
170        Or = 1,
171    }
172    impl BooleanOp {
173        /// String value of the enum field names used in the ProtoBuf definition.
174        ///
175        /// The values are not transformed in any way and thus are considered stable
176        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
177        pub fn as_str_name(&self) -> &'static str {
178            match self {
179                Self::And => "And",
180                Self::Or => "Or",
181            }
182        }
183        /// Creates an enum from field names used in the ProtoBuf definition.
184        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
185            match value {
186                "And" => Some(Self::And),
187                "Or" => Some(Self::Or),
188                _ => None,
189            }
190        }
191    }
192}
193/// Options for `vortex.numeric`
194#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
195pub struct NumericOpts {
196    #[prost(enumeration = "numeric_opts::NumericOp", tag = "1")]
197    pub op: i32,
198}
199/// Nested message and enum types in `NumericOpts`.
200pub mod numeric_opts {
201    #[derive(
202        Clone,
203        Copy,
204        Debug,
205        PartialEq,
206        Eq,
207        Hash,
208        PartialOrd,
209        Ord,
210        ::prost::Enumeration
211    )]
212    #[repr(i32)]
213    pub enum NumericOp {
214        Add = 0,
215        Sub = 1,
216        Mul = 2,
217        Div = 3,
218    }
219    impl NumericOp {
220        /// String value of the enum field names used in the ProtoBuf definition.
221        ///
222        /// The values are not transformed in any way and thus are considered stable
223        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
224        pub fn as_str_name(&self) -> &'static str {
225            match self {
226                Self::Add => "Add",
227                Self::Sub => "Sub",
228                Self::Mul => "Mul",
229                Self::Div => "Div",
230            }
231        }
232        /// Creates an enum from field names used in the ProtoBuf definition.
233        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
234            match value {
235                "Add" => Some(Self::Add),
236                "Sub" => Some(Self::Sub),
237                "Mul" => Some(Self::Mul),
238                "Div" => Some(Self::Div),
239                _ => None,
240            }
241        }
242    }
243}
244/// Options for the legacy `vortex.binary` function. Vortex no longer writes it. A reader converts
245/// it to `vortex.compare`, `vortex.boolean`, or `vortex.numeric`.
246#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
247pub struct BinaryOpts {
248    #[prost(enumeration = "binary_opts::BinaryOp", tag = "1")]
249    pub op: i32,
250}
251/// Nested message and enum types in `BinaryOpts`.
252pub mod binary_opts {
253    #[derive(
254        Clone,
255        Copy,
256        Debug,
257        PartialEq,
258        Eq,
259        Hash,
260        PartialOrd,
261        Ord,
262        ::prost::Enumeration
263    )]
264    #[repr(i32)]
265    pub enum BinaryOp {
266        Eq = 0,
267        NotEq = 1,
268        Gt = 2,
269        Gte = 3,
270        Lt = 4,
271        Lte = 5,
272        And = 6,
273        Or = 7,
274        Add = 8,
275        Sub = 9,
276        Mul = 10,
277        Div = 11,
278    }
279    impl BinaryOp {
280        /// String value of the enum field names used in the ProtoBuf definition.
281        ///
282        /// The values are not transformed in any way and thus are considered stable
283        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
284        pub fn as_str_name(&self) -> &'static str {
285            match self {
286                Self::Eq => "Eq",
287                Self::NotEq => "NotEq",
288                Self::Gt => "Gt",
289                Self::Gte => "Gte",
290                Self::Lt => "Lt",
291                Self::Lte => "Lte",
292                Self::And => "And",
293                Self::Or => "Or",
294                Self::Add => "Add",
295                Self::Sub => "Sub",
296                Self::Mul => "Mul",
297                Self::Div => "Div",
298            }
299        }
300        /// Creates an enum from field names used in the ProtoBuf definition.
301        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
302            match value {
303                "Eq" => Some(Self::Eq),
304                "NotEq" => Some(Self::NotEq),
305                "Gt" => Some(Self::Gt),
306                "Gte" => Some(Self::Gte),
307                "Lt" => Some(Self::Lt),
308                "Lte" => Some(Self::Lte),
309                "And" => Some(Self::And),
310                "Or" => Some(Self::Or),
311                "Add" => Some(Self::Add),
312                "Sub" => Some(Self::Sub),
313                "Mul" => Some(Self::Mul),
314                "Div" => Some(Self::Div),
315                _ => None,
316            }
317        }
318    }
319}
320#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
321pub struct BetweenOpts {
322    #[prost(bool, tag = "1")]
323    pub lower_strict: bool,
324    #[prost(bool, tag = "2")]
325    pub upper_strict: bool,
326}
327#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
328pub struct LikeOpts {
329    #[prost(bool, tag = "1")]
330    pub negated: bool,
331    #[prost(bool, tag = "2")]
332    pub case_insensitive: bool,
333}
334#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
335pub struct ListContainsOpts {
336    #[prost(bool, tag = "1")]
337    pub sql_null_semantics: bool,
338}
339#[derive(Clone, PartialEq, ::prost::Message)]
340pub struct CastOpts {
341    #[prost(message, optional, tag = "1")]
342    pub target: ::core::option::Option<super::dtype::DType>,
343}
344#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
345pub struct FieldNames {
346    #[prost(string, repeated, tag = "1")]
347    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
348}
349#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
350pub struct SelectOpts {
351    #[prost(oneof = "select_opts::Opts", tags = "1, 2")]
352    pub opts: ::core::option::Option<select_opts::Opts>,
353}
354/// Nested message and enum types in `SelectOpts`.
355pub mod select_opts {
356    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
357    pub enum Opts {
358        #[prost(message, tag = "1")]
359        Include(super::FieldNames),
360        #[prost(message, tag = "2")]
361        Exclude(super::FieldNames),
362    }
363}
364/// Options for `vortex.case_when`
365/// Encodes num_when_then_pairs and has_else into a single u32 (num_children).
366/// num_children = num_when_then_pairs * 2 + (has_else ? 1 : 0)
367/// has_else = num_children % 2 == 1
368/// num_when_then_pairs = num_children / 2
369#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
370pub struct CaseWhenOpts {
371    #[prost(uint32, tag = "1")]
372    pub num_children: u32,
373}
374/// Options for `vortex.replace_time_zone`. Ambiguity policy is an expression child.
375#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
376pub struct ReplaceTimeZoneOpts {
377    #[prost(string, optional, tag = "1")]
378    pub time_zone: ::core::option::Option<::prost::alloc::string::String>,
379    #[prost(bool, tag = "2")]
380    pub null_on_non_existent: bool,
381}