Skip to content

Commit

Permalink
Implement Eq trait for Expr and nest types (#3381)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdye64 authored Sep 7, 2022
1 parent 43e2d91 commit e6d1364
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datafusion/expr/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ use std::sync::Arc;
/// assert_eq!(op, Operator::Eq);
/// }
/// ```
#[derive(Clone, PartialEq, Hash)]
#[derive(Clone, PartialEq, Eq, Hash)]
pub enum Expr {
/// An expression with a specific name.
Alias(Box<Expr>, String),
Expand Down Expand Up @@ -293,7 +293,7 @@ pub enum Expr {
/// for Postgres definition.
/// See https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-groupby.html
/// for Apache Spark definition.
#[derive(Clone, PartialEq, Hash)]
#[derive(Clone, PartialEq, Eq, Hash)]
pub enum GroupingSet {
/// Rollup grouping sets
Rollup(Vec<Expr>),
Expand Down
2 changes: 2 additions & 0 deletions datafusion/expr/src/logical_plan/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,8 @@ impl PartialEq for Subquery {
}
}

impl Eq for Subquery {}

/// Logical partitioning schemes supported by the repartition operator.
#[derive(Debug, Clone)]
pub enum Partitioning {
Expand Down
2 changes: 2 additions & 0 deletions datafusion/expr/src/udaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ impl PartialEq for AggregateUDF {
}
}

impl Eq for AggregateUDF {}

impl std::hash::Hash for AggregateUDF {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.name.hash(state);
Expand Down
2 changes: 2 additions & 0 deletions datafusion/expr/src/udf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ impl PartialEq for ScalarUDF {
}
}

impl Eq for ScalarUDF {}

impl std::hash::Hash for ScalarUDF {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.name.hash(state);
Expand Down

0 comments on commit e6d1364

Please sign in to comment.