diff --git a/src/datatypes/field.rs b/src/datatypes/field.rs index fad96c7d40a..ec52e733e3d 100644 --- a/src/datatypes/field.rs +++ b/src/datatypes/field.rs @@ -3,7 +3,7 @@ use crate::error::{ArrowError, Result}; use super::{DataType, Metadata}; /// Represents the metadata of a "column". -#[derive(Debug, Clone, Eq, PartialEq, Hash)] +#[derive(Debug, Clone, Eq, PartialEq, Hash, PartialOrd, Ord)] pub struct Field { /// Its name pub name: String, diff --git a/src/datatypes/mod.rs b/src/datatypes/mod.rs index 8d9de83d583..ea66fd67e98 100644 --- a/src/datatypes/mod.rs +++ b/src/datatypes/mod.rs @@ -24,7 +24,7 @@ pub(crate) type Extension = Option<(String, Option)>; /// which declares the in-memory representation of data. /// The [`DataType::Extension`] is special in that it augments a [`DataType`] with metadata to support custom types. /// Use `to_logical_type` to desugar such type and return its correspoding logical type. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum DataType { /// Null type Null, @@ -151,7 +151,7 @@ pub enum DataType { } /// Mode of [`DataType::Union`] -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum UnionMode { /// Dense union Dense, @@ -182,7 +182,7 @@ impl UnionMode { } /// The time units defined in Arrow. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum TimeUnit { /// Time in seconds. Second, @@ -195,7 +195,7 @@ pub enum TimeUnit { } /// Interval units defined in Arrow -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum IntervalUnit { /// The number of elapsed whole months. YearMonth, diff --git a/src/datatypes/physical_type.rs b/src/datatypes/physical_type.rs index 7e15cb19629..e8a9153a2ca 100644 --- a/src/datatypes/physical_type.rs +++ b/src/datatypes/physical_type.rs @@ -50,7 +50,7 @@ impl PhysicalType { /// the set of valid indices types of a dictionary-encoded Array. /// Each type corresponds to a variant of [`crate::array::DictionaryArray`]. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum IntegerType { /// A signed 8-bit integer. Int8,