Skip to content

Commit 1393097

Browse files
jdye64MazterQyou
authored andcommitted
Implement Eq trait for Expr and nest types (apache#3381)
1 parent 2bfed6a commit 1393097

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

datafusion/expr/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ use std::sync::Arc;
8080
/// assert_eq!(op, Operator::Eq);
8181
/// }
8282
/// ```
83-
#[derive(Clone, PartialEq, Hash)]
83+
#[derive(Clone, PartialEq, Eq, Hash)]
8484
pub enum Expr {
8585
/// An expression with a specific name.
8686
Alias(Box<Expr>, String),

datafusion/expr/src/udaf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ impl PartialEq for AggregateUDF {
5656
}
5757
}
5858

59+
impl Eq for AggregateUDF {}
60+
5961
impl std::hash::Hash for AggregateUDF {
6062
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
6163
self.name.hash(state);

datafusion/expr/src/udf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ impl PartialEq for ScalarUDF {
5959
}
6060
}
6161

62+
impl Eq for ScalarUDF {}
63+
6264
impl std::hash::Hash for ScalarUDF {
6365
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
6466
self.name.hash(state);

datafusion/expr/src/udtf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ impl PartialEq for TableUDF {
5252
}
5353
}
5454

55+
impl Eq for TableUDF {}
56+
5557
impl std::hash::Hash for TableUDF {
5658
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
5759
self.name.hash(state);

0 commit comments

Comments
 (0)