-
Notifications
You must be signed in to change notification settings - Fork 224
Removed PartialOrd
and Ord
of all enums in datatypes
#379
Conversation
Codecov Report
@@ Coverage Diff @@
## main #379 +/- ##
========================================
Coverage 81.08% 81.09%
========================================
Files 328 330 +2
Lines 21748 21976 +228
========================================
+ Hits 17635 17821 +186
- Misses 4113 4155 +42
Continue to review full report at Codecov.
|
datatypes
PartialOrd
and Ord
of all enums in datatypes
Hi @jorgecarleitao , arrow-datafusion added #[derive(Clone, PartialEq, PartialOrd)]
pub enum Expr {
....
Cast {
/// The expression being cast
expr: Box<Expr>,
/// The `DataType` the expression will yield
data_type: DataType, // <- need DataType PartialOrd as well.
},
} Introduced in apache/datafusion#1014 to provide the capability of sorting expressions, for common-subexpression-elimination and further expression transformations. any thoughts on this? |
Ufff 😢 What is the semantics that the partial ord is trying to achieve in DataFusion? I am a bit surprised that it is relying on the derived |
Yes, I think so, for stabilizing tests (https://github.com/influxdata/influxdb_iox/pull/2564#discussion_r710289316) and expression algebraic transformations, as the issue brought this in explained apache/datafusion#1014 |
yeah, i don't think the ordering semantic matters here, just need a consistent ordering defined. |
Pushed a workaround to implement partial ord using hash in datafusion: houqp/arrow-datafusion@99ee159. |
wow, quite neat idea! I had already given up and was dragging my feet to revert part of this PR and re-introduce partialOrd on
I am so glad that you found a way there! |
PartialOrd
norOrd
, since there is no natural order on them.IntervalUnit
andTimeUnit
Copy
, since they are simple enums.