diff --git a/datafusion/expr-common/src/signature.rs b/datafusion/expr-common/src/signature.rs index dee8fc618354..f2cde4527f0c 100644 --- a/datafusion/expr-common/src/signature.rs +++ b/datafusion/expr-common/src/signature.rs @@ -156,7 +156,7 @@ impl TypeSignature { } } -#[derive(Debug, Clone, Eq, PartialOrd)] +#[derive(Debug, Clone, Eq, PartialEq, PartialOrd, Hash)] pub enum TypeSignatureClass { Timestamp, Date, @@ -169,22 +169,6 @@ pub enum TypeSignatureClass { Native(LogicalTypeRef), } -// TODO: MSRV issue: Default macro doesn't work in 1.79. Use default PartialEq macro after it is able to compile -impl PartialEq for TypeSignatureClass { - fn eq(&self, other: &Self) -> bool { - match (self, other) { - (Self::Native(l0), Self::Native(r0)) => l0 == r0, - _ => core::mem::discriminant(self) == core::mem::discriminant(other), - } - } -} - -impl std::hash::Hash for TypeSignatureClass { - fn hash(&self, state: &mut H) { - core::mem::discriminant(self).hash(state); - } -} - impl Display for TypeSignatureClass { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "TypeSignatureClass::{self:?}") diff --git a/datafusion/sqllogictest/test_files/expr.slt b/datafusion/sqllogictest/test_files/expr.slt index f7902af5d4b3..2a8ce39738c8 100644 --- a/datafusion/sqllogictest/test_files/expr.slt +++ b/datafusion/sqllogictest/test_files/expr.slt @@ -1109,15 +1109,10 @@ SELECT date_part('second', timestamp '2020-09-08T12:00:12.12345678+00:00') ---- 12 -query I -SELECT date_part('millisecond', timestamp '2020-09-08T12:00:12.12345678+00:00') ----- -12 - query I SELECT date_part('microsecond', timestamp '2020-09-08T12:00:12.12345678+00:00') ---- -12123 +12123456 query error DataFusion error: Internal error: unit Nanosecond not supported SELECT date_part('nanosecond', timestamp '2020-09-08T12:00:12.12345678+00:00') diff --git a/datafusion/sqllogictest/test_files/group_by.slt b/datafusion/sqllogictest/test_files/group_by.slt index fc09b5242141..df7e21c2da44 100644 --- a/datafusion/sqllogictest/test_files/group_by.slt +++ b/datafusion/sqllogictest/test_files/group_by.slt @@ -4281,7 +4281,7 @@ EXPLAIN SELECT extract(month from ts) as months logical_plan 01)Sort: months DESC NULLS FIRST, fetch=5 02)--Projection: date_part(Utf8("MONTH"),csv_with_timestamps.ts) AS months -03)----Aggregate: groupBy=[[date_part(Utf8View("MONTH"), csv_with_timestamps.ts) AS date_part(Utf8("MONTH"),csv_with_timestamps.ts)]], aggr=[[]] +03)----Aggregate: groupBy=[[date_part(Utf8("MONTH"), csv_with_timestamps.ts)]], aggr=[[]] 04)------TableScan: csv_with_timestamps projection=[ts] physical_plan 01)SortPreservingMergeExec: [months@0 DESC], fetch=5