vortex-array 0.95.0

Vortex in memory columnar data format
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors
//
// @generated by `cargo run -p xtask -- generate-proto`, do not modify.

// This file is @generated by prost-build.
/// Captures a generic representation of expressions in Vortex.
/// Expression deserializers can be registered with a Vortex session to handle parsing this into
/// an in-memory expression for execution.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Expr {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub children: ::prost::alloc::vec::Vec<Expr>,
    #[prost(bytes = "vec", optional, tag = "3")]
    pub metadata: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
/// Captures a serialized aggregate function with its ID and options metadata.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AggregateFn {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(bytes = "vec", optional, tag = "2")]
    pub metadata: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
/// Options for numeric aggregate functions (`vortex.sum`, `vortex.min`, `vortex.max`),
/// controlling how NaN values in floating-point inputs are handled.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NumericalAggregateOpts {
    #[prost(bool, tag = "1")]
    pub skip_nans: bool,
}
/// Options for `vortex.literal`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiteralOpts {
    #[prost(message, optional, tag = "1")]
    pub value: ::core::option::Option<super::scalar::Scalar>,
}
/// Options for `vortex.pack`
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PackOpts {
    #[prost(string, repeated, tag = "1")]
    pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(bool, tag = "2")]
    pub nullable: bool,
}
/// Options for `vortex.getitem`
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetItemOpts {
    #[prost(string, tag = "1")]
    pub path: ::prost::alloc::string::String,
}
/// Options for `vortex.variant_get`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VariantGetOpts {
    #[prost(message, repeated, tag = "1")]
    pub path: ::prost::alloc::vec::Vec<VariantPathElement>,
    #[prost(message, optional, tag = "2")]
    pub dtype: ::core::option::Option<super::dtype::DType>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct VariantPathElement {
    #[prost(oneof = "variant_path_element::Element", tags = "1, 2")]
    pub element: ::core::option::Option<variant_path_element::Element>,
}
/// Nested message and enum types in `VariantPathElement`.
pub mod variant_path_element {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Element {
        #[prost(string, tag = "1")]
        Field(::prost::alloc::string::String),
        #[prost(uint64, tag = "2")]
        Index(u64),
    }
}
/// Options for `vortex.json_to_variant`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JsonToVariantOpts {
    #[prost(message, repeated, tag = "1")]
    pub shredding: ::prost::alloc::vec::Vec<ShreddingSpecField>,
}
/// One (path, dtype) shredding directive for `vortex.json_to_variant`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShreddingSpecField {
    #[prost(message, repeated, tag = "1")]
    pub path: ::prost::alloc::vec::Vec<VariantPathElement>,
    #[prost(message, optional, tag = "2")]
    pub dtype: ::core::option::Option<super::dtype::DType>,
}
/// Options for `vortex.compare`
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CompareOpts {
    #[prost(enumeration = "compare_opts::CompareOp", tag = "1")]
    pub op: i32,
}
/// Nested message and enum types in `CompareOpts`.
pub mod compare_opts {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum CompareOp {
        Eq = 0,
        NotEq = 1,
        Gt = 2,
        Gte = 3,
        Lt = 4,
        Lte = 5,
    }
    impl CompareOp {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Eq => "Eq",
                Self::NotEq => "NotEq",
                Self::Gt => "Gt",
                Self::Gte => "Gte",
                Self::Lt => "Lt",
                Self::Lte => "Lte",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "Eq" => Some(Self::Eq),
                "NotEq" => Some(Self::NotEq),
                "Gt" => Some(Self::Gt),
                "Gte" => Some(Self::Gte),
                "Lt" => Some(Self::Lt),
                "Lte" => Some(Self::Lte),
                _ => None,
            }
        }
    }
}
/// Options for `vortex.boolean`
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BooleanOpts {
    #[prost(enumeration = "boolean_opts::BooleanOp", tag = "1")]
    pub op: i32,
}
/// Nested message and enum types in `BooleanOpts`.
pub mod boolean_opts {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum BooleanOp {
        And = 0,
        Or = 1,
    }
    impl BooleanOp {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::And => "And",
                Self::Or => "Or",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "And" => Some(Self::And),
                "Or" => Some(Self::Or),
                _ => None,
            }
        }
    }
}
/// Options for `vortex.numeric`
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NumericOpts {
    #[prost(enumeration = "numeric_opts::NumericOp", tag = "1")]
    pub op: i32,
}
/// Nested message and enum types in `NumericOpts`.
pub mod numeric_opts {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum NumericOp {
        Add = 0,
        Sub = 1,
        Mul = 2,
        Div = 3,
    }
    impl NumericOp {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Add => "Add",
                Self::Sub => "Sub",
                Self::Mul => "Mul",
                Self::Div => "Div",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "Add" => Some(Self::Add),
                "Sub" => Some(Self::Sub),
                "Mul" => Some(Self::Mul),
                "Div" => Some(Self::Div),
                _ => None,
            }
        }
    }
}
/// Options for the legacy `vortex.binary` function. Vortex no longer writes it. A reader converts
/// it to `vortex.compare`, `vortex.boolean`, or `vortex.numeric`.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BinaryOpts {
    #[prost(enumeration = "binary_opts::BinaryOp", tag = "1")]
    pub op: i32,
}
/// Nested message and enum types in `BinaryOpts`.
pub mod binary_opts {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum BinaryOp {
        Eq = 0,
        NotEq = 1,
        Gt = 2,
        Gte = 3,
        Lt = 4,
        Lte = 5,
        And = 6,
        Or = 7,
        Add = 8,
        Sub = 9,
        Mul = 10,
        Div = 11,
    }
    impl BinaryOp {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Eq => "Eq",
                Self::NotEq => "NotEq",
                Self::Gt => "Gt",
                Self::Gte => "Gte",
                Self::Lt => "Lt",
                Self::Lte => "Lte",
                Self::And => "And",
                Self::Or => "Or",
                Self::Add => "Add",
                Self::Sub => "Sub",
                Self::Mul => "Mul",
                Self::Div => "Div",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "Eq" => Some(Self::Eq),
                "NotEq" => Some(Self::NotEq),
                "Gt" => Some(Self::Gt),
                "Gte" => Some(Self::Gte),
                "Lt" => Some(Self::Lt),
                "Lte" => Some(Self::Lte),
                "And" => Some(Self::And),
                "Or" => Some(Self::Or),
                "Add" => Some(Self::Add),
                "Sub" => Some(Self::Sub),
                "Mul" => Some(Self::Mul),
                "Div" => Some(Self::Div),
                _ => None,
            }
        }
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BetweenOpts {
    #[prost(bool, tag = "1")]
    pub lower_strict: bool,
    #[prost(bool, tag = "2")]
    pub upper_strict: bool,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LikeOpts {
    #[prost(bool, tag = "1")]
    pub negated: bool,
    #[prost(bool, tag = "2")]
    pub case_insensitive: bool,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListContainsOpts {
    #[prost(bool, tag = "1")]
    pub sql_null_semantics: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CastOpts {
    #[prost(message, optional, tag = "1")]
    pub target: ::core::option::Option<super::dtype::DType>,
}
/// Options for `vortex.change_time_unit`.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChangeTimeUnitOpts {
    /// The target time unit, as the same code that the temporal dtype metadata stores.
    #[prost(uint32, tag = "1")]
    pub unit: u32,
    #[prost(enumeration = "change_time_unit_opts::Rounding", tag = "2")]
    pub rounding: i32,
}
/// Nested message and enum types in `ChangeTimeUnitOpts`.
pub mod change_time_unit_opts {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Rounding {
        Exact = 0,
        TowardZero = 1,
        Floor = 2,
        NearestTiesAwayFromZero = 3,
    }
    impl Rounding {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Exact => "EXACT",
                Self::TowardZero => "TOWARD_ZERO",
                Self::Floor => "FLOOR",
                Self::NearestTiesAwayFromZero => "NEAREST_TIES_AWAY_FROM_ZERO",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "EXACT" => Some(Self::Exact),
                "TOWARD_ZERO" => Some(Self::TowardZero),
                "FLOOR" => Some(Self::Floor),
                "NEAREST_TIES_AWAY_FROM_ZERO" => Some(Self::NearestTiesAwayFromZero),
                _ => None,
            }
        }
    }
}
/// Options for `vortex.convert_time_zone`.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ConvertTimeZoneOpts {
    #[prost(string, tag = "1")]
    pub time_zone: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FieldNames {
    #[prost(string, repeated, tag = "1")]
    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SelectOpts {
    #[prost(oneof = "select_opts::Opts", tags = "1, 2")]
    pub opts: ::core::option::Option<select_opts::Opts>,
}
/// Nested message and enum types in `SelectOpts`.
pub mod select_opts {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Opts {
        #[prost(message, tag = "1")]
        Include(super::FieldNames),
        #[prost(message, tag = "2")]
        Exclude(super::FieldNames),
    }
}
/// Options for `vortex.case_when`
/// Encodes num_when_then_pairs and has_else into a single u32 (num_children).
/// num_children = num_when_then_pairs * 2 + (has_else ? 1 : 0)
/// has_else = num_children % 2 == 1
/// num_when_then_pairs = num_children / 2
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CaseWhenOpts {
    #[prost(uint32, tag = "1")]
    pub num_children: u32,
}
/// Options for `vortex.replace_time_zone`. Ambiguity policy is an expression child.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReplaceTimeZoneOpts {
    #[prost(string, optional, tag = "1")]
    pub time_zone: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(bool, tag = "2")]
    pub null_on_non_existent: bool,
}