tustvold commented on code in PR #2471:
URL: https://github.com/apache/arrow-rs/pull/2471#discussion_r947598035
##########
parquet/src/data_type.rs:
##########
@@ -36,29 +36,27 @@ use crate::util::{
/// Rust representation for logical type INT96, value is backed by an array of
`u32`.
/// The type only takes 12 bytes, without extra padding.
-#[derive(Clone, Debug, PartialOrd, Default)]
+#[derive(Clone, Debug, PartialOrd, Default, PartialEq, Eq)]
pub struct Int96 {
- value: Option<[u32; 3]>,
+ value: [u32; 3],
}
impl Int96 {
/// Creates new INT96 type struct with no data set.
pub fn new() -> Self {
- Self { value: None }
+ Self { value: [0; 3] }
}
/// Returns underlying data as slice of [`u32`].
#[inline]
pub fn data(&self) -> &[u32] {
- self.value
- .as_ref()
- .expect("set_data should have been called")
Review Comment:
I don't follow why we would care about this for Int96 and not for all the
other types. This feels like an unnecessary quirk?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]