Skip to content

Commit 07368ee

Browse files
committed
Remove lenient prost enum methods from strict metadata
Signed-off-by: Connor Tsui <[email protected]>
1 parent 71df8d5 commit 07368ee

10 files changed

Lines changed: 19 additions & 18 deletions

File tree

‎encodings/alp/src/alp_rd/array.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub struct ALPRDMetadata {
6666
dict_len: u32,
6767
#[prost(uint32, repeated, tag = "3")]
6868
dict: Vec<u32>,
69-
#[prost(enumeration = "PType", tag = "4")]
69+
#[prost(int32, tag = "4")]
7070
left_parts_ptype: i32,
7171
#[prost(message, tag = "5")]
7272
patches: Option<PatchesMetadata>,

‎encodings/fastlanes/src/rle/vtable/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ pub struct RLEMetadata {
5252
pub values_len: u64,
5353
#[prost(uint64, tag = "2")]
5454
pub indices_len: u64,
55-
#[prost(enumeration = "PType", tag = "3")]
55+
#[prost(int32, tag = "3")]
5656
pub indices_ptype: i32,
5757
#[prost(uint64, tag = "4")]
5858
pub values_idx_offsets_len: u64,
59-
#[prost(enumeration = "PType", tag = "5")]
59+
#[prost(int32, tag = "5")]
6060
pub values_idx_offsets_ptype: i32,
6161
#[prost(uint64, tag = "6", default = "0")]
6262
pub offset: u64,

‎encodings/runend/src/array.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub type RunEndArray = Array<RunEnd>;
6262

6363
#[derive(Clone, prost::Message)]
6464
pub struct RunEndMetadata {
65-
#[prost(enumeration = "PType", tag = "1")]
65+
#[prost(int32, tag = "1")]
6666
pub ends_ptype: i32,
6767
#[prost(uint64, tag = "2")]
6868
pub num_runs: u64,

‎vortex-array/src/arrays/decimal/vtable/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub(crate) fn initialize(session: &VortexSession) {
5353
// The type of the values can be determined by looking at the type info...right?
5454
#[derive(prost::Message)]
5555
pub struct DecimalMetadata {
56-
#[prost(enumeration = "DecimalType", tag = "1")]
56+
#[prost(int32, tag = "1")]
5757
pub(super) values_type: i32,
5858
}
5959

‎vortex-array/src/arrays/dict/array.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use crate::match_each_integer_ptype;
3131
pub struct DictMetadata {
3232
#[prost(uint32, tag = "1")]
3333
pub(super) values_len: u32,
34-
#[prost(enumeration = "PType", tag = "2")]
34+
#[prost(int32, tag = "2")]
3535
pub(super) codes_ptype: i32,
3636
// nullable codes are optional since they were added after stabilisation.
3737
#[prost(optional, bool, tag = "3")]

‎vortex-array/src/arrays/list/vtable/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub type ListArray = Array<List>;
5050
pub struct ListMetadata {
5151
#[prost(uint64, tag = "1")]
5252
elements_len: u64,
53-
#[prost(enumeration = "PType", tag = "2")]
53+
#[prost(int32, tag = "2")]
5454
offset_ptype: i32,
5555
}
5656

‎vortex-array/src/arrays/listview/vtable/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ pub struct ListView;
5858
pub struct ListViewMetadata {
5959
#[prost(uint64, tag = "1")]
6060
elements_len: u64,
61-
#[prost(enumeration = "PType", tag = "2")]
61+
#[prost(int32, tag = "2")]
6262
offset_ptype: i32,
63-
#[prost(enumeration = "PType", tag = "3")]
63+
#[prost(int32, tag = "3")]
6464
size_ptype: i32,
6565
}
6666

‎vortex-array/src/arrays/varbin/vtable/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub(crate) fn initialize(session: &VortexSession) {
6060

6161
#[derive(Clone, prost::Message)]
6262
pub struct VarBinMetadata {
63-
#[prost(enumeration = "PType", tag = "1")]
63+
#[prost(int32, tag = "1")]
6464
pub(crate) offsets_ptype: i32,
6565
}
6666

‎vortex-layout/src/layouts/dict/mod.rs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl Layout<Dict> {
164164

165165
#[derive(prost::Message)]
166166
pub struct DictLayoutMetadata {
167-
#[prost(enumeration = "PType", tag = "1")]
167+
#[prost(int32, tag = "1")]
168168
codes_ptype: i32,
169169
#[prost(optional, bool, tag = "2")]
170170
is_nullable_codes: Option<bool>,
@@ -174,9 +174,10 @@ pub struct DictLayoutMetadata {
174174

175175
impl DictLayoutMetadata {
176176
pub fn new(codes_ptype: PType) -> Self {
177-
let mut metadata = Self::default();
178-
metadata.set_codes_ptype(codes_ptype);
179-
metadata
177+
Self {
178+
codes_ptype: codes_ptype as i32,
179+
..Default::default()
180+
}
180181
}
181182

182183
fn get_codes_ptype(&self) -> VortexResult<PType> {

‎vortex-layout/src/layouts/list/mod.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,15 @@ impl Layout<List> {
226226

227227
#[derive(prost::Message)]
228228
pub struct ListLayoutMetadata {
229-
#[prost(enumeration = "PType", tag = "1")]
229+
#[prost(int32, tag = "1")]
230230
offsets_ptype: i32,
231231
}
232232

233233
impl ListLayoutMetadata {
234234
pub fn new(offsets_ptype: PType) -> Self {
235-
let mut metadata = Self::default();
236-
metadata.set_offsets_ptype(offsets_ptype);
237-
metadata
235+
Self {
236+
offsets_ptype: offsets_ptype as i32,
237+
}
238238
}
239239

240240
fn get_offsets_ptype(&self) -> VortexResult<PType> {

0 commit comments

Comments
 (0)