@@ -2060,7 +2060,10 @@ pub struct EmptyRelation {
20602060// Manual implementation needed because of `schema` field. Comparison excludes this field.
20612061impl PartialOrd for EmptyRelation {
20622062 fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
2063- self . produce_one_row . partial_cmp ( & other. produce_one_row )
2063+ self . produce_one_row
2064+ . partial_cmp ( & other. produce_one_row )
2065+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
2066+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
20642067 }
20652068}
20662069
@@ -2114,7 +2117,10 @@ pub struct Values {
21142117// Manual implementation needed because of `schema` field. Comparison excludes this field.
21152118impl PartialOrd for Values {
21162119 fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
2117- self . values . partial_cmp ( & other. values )
2120+ self . values
2121+ . partial_cmp ( & other. values )
2122+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
2123+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
21182124 }
21192125}
21202126
@@ -2139,6 +2145,8 @@ impl PartialOrd for Projection {
21392145 Some ( Ordering :: Equal ) => self . input . partial_cmp ( & other. input ) ,
21402146 cmp => cmp,
21412147 }
2148+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
2149+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
21422150 }
21432151}
21442152
@@ -2249,6 +2257,8 @@ impl PartialOrd for SubqueryAlias {
22492257 Some ( Ordering :: Equal ) => self . alias . partial_cmp ( & other. alias ) ,
22502258 cmp => cmp,
22512259 }
2260+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
2261+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
22522262 }
22532263}
22542264
@@ -2606,7 +2616,10 @@ impl PartialOrd for TableScan {
26062616 filters : & other. filters ,
26072617 fetch : & other. fetch ,
26082618 } ;
2609- comparable_self. partial_cmp ( & comparable_other)
2619+ comparable_self
2620+ . partial_cmp ( & comparable_other)
2621+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
2622+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
26102623 }
26112624}
26122625
@@ -2929,7 +2942,10 @@ impl Union {
29292942// Manual implementation needed because of `schema` field. Comparison excludes this field.
29302943impl PartialOrd for Union {
29312944 fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
2932- self . inputs . partial_cmp ( & other. inputs )
2945+ self . inputs
2946+ . partial_cmp ( & other. inputs )
2947+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
2948+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
29332949 }
29342950}
29352951
@@ -3210,7 +3226,10 @@ impl PartialOrd for Explain {
32103226 stringified_plans : & other. stringified_plans ,
32113227 logical_optimization_succeeded : & other. logical_optimization_succeeded ,
32123228 } ;
3213- comparable_self. partial_cmp ( & comparable_other)
3229+ comparable_self
3230+ . partial_cmp ( & comparable_other)
3231+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
3232+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
32143233 }
32153234}
32163235
@@ -3233,6 +3252,8 @@ impl PartialOrd for Analyze {
32333252 Some ( Ordering :: Equal ) => self . input . partial_cmp ( & other. input ) ,
32343253 cmp => cmp,
32353254 }
3255+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
3256+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
32363257 }
32373258}
32383259
@@ -3460,7 +3481,10 @@ impl PartialOrd for DistinctOn {
34603481 sort_expr : & other. sort_expr ,
34613482 input : & other. input ,
34623483 } ;
3463- comparable_self. partial_cmp ( & comparable_other)
3484+ comparable_self
3485+ . partial_cmp ( & comparable_other)
3486+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
3487+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
34643488 }
34653489}
34663490
@@ -3647,6 +3671,8 @@ impl PartialOrd for Aggregate {
36473671 }
36483672 cmp => cmp,
36493673 }
3674+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
3675+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
36503676 }
36513677}
36523678
@@ -3919,7 +3945,10 @@ impl PartialOrd for Join {
39193945 join_constraint : & other. join_constraint ,
39203946 null_equality : & other. null_equality ,
39213947 } ;
3922- comparable_self. partial_cmp ( & comparable_other)
3948+ comparable_self
3949+ . partial_cmp ( & comparable_other)
3950+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
3951+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
39233952 }
39243953}
39253954
@@ -4084,7 +4113,10 @@ impl PartialOrd for Unnest {
40844113 dependency_indices : & other. dependency_indices ,
40854114 options : & other. options ,
40864115 } ;
4087- comparable_self. partial_cmp ( & comparable_other)
4116+ comparable_self
4117+ . partial_cmp ( & comparable_other)
4118+ // TODO (https://github.com/apache/datafusion/issues/17477) avoid recomparing all fields
4119+ . filter ( |cmp| * cmp != Ordering :: Equal || self == other)
40884120 }
40894121}
40904122
0 commit comments