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.uncompressed_size_in_bytes`: whether the size is an approximation from the
35/// buffers the array holds (the default) or the actual bytes its rows use.
36#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
37pub struct UncompressedSizeInBytesOpts {
38    #[prost(bool, tag = "1")]
39    pub exact: bool,
40}
41/// Options for `vortex.literal`
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct LiteralOpts {
44    #[prost(message, optional, tag = "1")]
45    pub value: ::core::option::Option<super::scalar::Scalar>,
46}
47/// Options for `vortex.pack`
48#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
49pub struct PackOpts {
50    #[prost(string, repeated, tag = "1")]
51    pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
52    #[prost(bool, tag = "2")]
53    pub nullable: bool,
54}
55/// Options for `vortex.getitem`
56#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
57pub struct GetItemOpts {
58    #[prost(string, tag = "1")]
59    pub path: ::prost::alloc::string::String,
60}
61/// Options for `vortex.variant_get`
62#[derive(Clone, PartialEq, ::prost::Message)]
63pub struct VariantGetOpts {
64    #[prost(message, repeated, tag = "1")]
65    pub path: ::prost::alloc::vec::Vec<VariantPathElement>,
66    #[prost(message, optional, tag = "2")]
67    pub dtype: ::core::option::Option<super::dtype::DType>,
68}
69#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
70pub struct VariantPathElement {
71    #[prost(oneof = "variant_path_element::Element", tags = "1, 2")]
72    pub element: ::core::option::Option<variant_path_element::Element>,
73}
74/// Nested message and enum types in `VariantPathElement`.
75pub mod variant_path_element {
76    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
77    pub enum Element {
78        #[prost(string, tag = "1")]
79        Field(::prost::alloc::string::String),
80        #[prost(uint64, tag = "2")]
81        Index(u64),
82    }
83}
84/// Options for `vortex.json_to_variant`
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct JsonToVariantOpts {
87    #[prost(message, repeated, tag = "1")]
88    pub shredding: ::prost::alloc::vec::Vec<ShreddingSpecField>,
89}
90/// One (path, dtype) shredding directive for `vortex.json_to_variant`.
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct ShreddingSpecField {
93    #[prost(message, repeated, tag = "1")]
94    pub path: ::prost::alloc::vec::Vec<VariantPathElement>,
95    #[prost(message, optional, tag = "2")]
96    pub dtype: ::core::option::Option<super::dtype::DType>,
97}
98/// Options for `vortex.binary`
99#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
100pub struct BinaryOpts {
101    #[prost(enumeration = "binary_opts::BinaryOp", tag = "1")]
102    pub op: i32,
103}
104/// Nested message and enum types in `BinaryOpts`.
105pub mod binary_opts {
106    #[derive(
107        Clone,
108        Copy,
109        Debug,
110        PartialEq,
111        Eq,
112        Hash,
113        PartialOrd,
114        Ord,
115        ::prost::Enumeration
116    )]
117    #[repr(i32)]
118    pub enum BinaryOp {
119        Eq = 0,
120        NotEq = 1,
121        Gt = 2,
122        Gte = 3,
123        Lt = 4,
124        Lte = 5,
125        And = 6,
126        Or = 7,
127        Add = 8,
128        Sub = 9,
129        Mul = 10,
130        Div = 11,
131    }
132    impl BinaryOp {
133        /// String value of the enum field names used in the ProtoBuf definition.
134        ///
135        /// The values are not transformed in any way and thus are considered stable
136        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
137        pub fn as_str_name(&self) -> &'static str {
138            match self {
139                Self::Eq => "Eq",
140                Self::NotEq => "NotEq",
141                Self::Gt => "Gt",
142                Self::Gte => "Gte",
143                Self::Lt => "Lt",
144                Self::Lte => "Lte",
145                Self::And => "And",
146                Self::Or => "Or",
147                Self::Add => "Add",
148                Self::Sub => "Sub",
149                Self::Mul => "Mul",
150                Self::Div => "Div",
151            }
152        }
153        /// Creates an enum from field names used in the ProtoBuf definition.
154        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
155            match value {
156                "Eq" => Some(Self::Eq),
157                "NotEq" => Some(Self::NotEq),
158                "Gt" => Some(Self::Gt),
159                "Gte" => Some(Self::Gte),
160                "Lt" => Some(Self::Lt),
161                "Lte" => Some(Self::Lte),
162                "And" => Some(Self::And),
163                "Or" => Some(Self::Or),
164                "Add" => Some(Self::Add),
165                "Sub" => Some(Self::Sub),
166                "Mul" => Some(Self::Mul),
167                "Div" => Some(Self::Div),
168                _ => None,
169            }
170        }
171    }
172}
173#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
174pub struct BetweenOpts {
175    #[prost(bool, tag = "1")]
176    pub lower_strict: bool,
177    #[prost(bool, tag = "2")]
178    pub upper_strict: bool,
179}
180#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
181pub struct LikeOpts {
182    #[prost(bool, tag = "1")]
183    pub negated: bool,
184    #[prost(bool, tag = "2")]
185    pub case_insensitive: bool,
186}
187#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
188pub struct ListContainsOpts {
189    #[prost(bool, tag = "1")]
190    pub sql_null_semantics: bool,
191}
192#[derive(Clone, PartialEq, ::prost::Message)]
193pub struct CastOpts {
194    #[prost(message, optional, tag = "1")]
195    pub target: ::core::option::Option<super::dtype::DType>,
196}
197#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
198pub struct FieldNames {
199    #[prost(string, repeated, tag = "1")]
200    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
201}
202#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
203pub struct SelectOpts {
204    #[prost(oneof = "select_opts::Opts", tags = "1, 2")]
205    pub opts: ::core::option::Option<select_opts::Opts>,
206}
207/// Nested message and enum types in `SelectOpts`.
208pub mod select_opts {
209    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
210    pub enum Opts {
211        #[prost(message, tag = "1")]
212        Include(super::FieldNames),
213        #[prost(message, tag = "2")]
214        Exclude(super::FieldNames),
215    }
216}
217/// Options for `vortex.case_when`
218/// Encodes num_when_then_pairs and has_else into a single u32 (num_children).
219/// num_children = num_when_then_pairs * 2 + (has_else ? 1 : 0)
220/// has_else = num_children % 2 == 1
221/// num_when_then_pairs = num_children / 2
222#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
223pub struct CaseWhenOpts {
224    #[prost(uint32, tag = "1")]
225    pub num_children: u32,
226}
227/// Options for `vortex.replace_time_zone`. Ambiguity policy is an expression child.
228#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
229pub struct ReplaceTimeZoneOpts {
230    #[prost(string, optional, tag = "1")]
231    pub time_zone: ::core::option::Option<::prost::alloc::string::String>,
232    #[prost(bool, tag = "2")]
233    pub null_on_non_existent: bool,
234}