You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2022/09/07 15:16:55 UTC
[arrow-datafusion] branch master updated: Implement Eq trait for Expr and nest types (#3381)
This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/master by this push:
new e6d13646c Implement Eq trait for Expr and nest types (#3381)
e6d13646c is described below
commit e6d13646c746c576b5eed8c9a21ac59d783f2910
Author: Jeremy Dyer <jd...@gmail.com>
AuthorDate: Wed Sep 7 11:16:50 2022 -0400
Implement Eq trait for Expr and nest types (#3381)
---
datafusion/expr/src/expr.rs | 4 ++--
datafusion/expr/src/logical_plan/plan.rs | 2 ++
datafusion/expr/src/udaf.rs | 2 ++
datafusion/expr/src/udf.rs | 2 ++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/datafusion/expr/src/expr.rs b/datafusion/expr/src/expr.rs
index 6226887e8..ab45dd67d 100644
--- a/datafusion/expr/src/expr.rs
+++ b/datafusion/expr/src/expr.rs
@@ -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),
@@ -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>),
diff --git a/datafusion/expr/src/logical_plan/plan.rs b/datafusion/expr/src/logical_plan/plan.rs
index 0cc0c28e8..6770e310c 100644
--- a/datafusion/expr/src/logical_plan/plan.rs
+++ b/datafusion/expr/src/logical_plan/plan.rs
@@ -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 {
diff --git a/datafusion/expr/src/udaf.rs b/datafusion/expr/src/udaf.rs
index 8c15da40f..00f48dda2 100644
--- a/datafusion/expr/src/udaf.rs
+++ b/datafusion/expr/src/udaf.rs
@@ -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);
diff --git a/datafusion/expr/src/udf.rs b/datafusion/expr/src/udf.rs
index 4d60b2994..ffb98bc7a 100644
--- a/datafusion/expr/src/udf.rs
+++ b/datafusion/expr/src/udf.rs
@@ -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);