Skip to content

Commit

Permalink
Implement Eq trait for Expr and nest types (apache#3381)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdye64 authored and MazterQyou committed Dec 1, 2022
1 parent 2bfed6a commit 1393097
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion datafusion/expr/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,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
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
2 changes: 2 additions & 0 deletions datafusion/expr/src/udtf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ impl PartialEq for TableUDF {
}
}

impl Eq for TableUDF {}

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

0 comments on commit 1393097

Please sign in to comment.