jayzhan211 commented on code in PR #24276:
URL: https://github.com/apache/datafusion/pull/24276#discussion_r3790772429
##########
datafusion/expr-common/src/sort_properties.rs:
##########
@@ -89,35 +91,410 @@ impl SortProperties {
}),
(_, Self::Singleton) => *self,
(Self::Ordered(lhs), Self::Ordered(rhs))
- if lhs.descending != rhs.descending =>
+ if lhs.descending != rhs.descending
+ && lhs.nulls_first == rhs.nulls_first =>
{
*self
}
_ => Self::Unordered,
}
}
+ pub fn and(&self, rhs: &Self) -> Self {
+ // `descending == nulls_first` selects ASC NULLS LAST / DESC NULLS
FIRST.
+ self.kleene(rhs, |opt| opt.descending == opt.nulls_first)
+ }
+
+ pub fn or(&self, rhs: &Self) -> Self {
+ // `descending != nulls_first` selects ASC NULLS FIRST / DESC NULLS
LAST.
+ self.kleene(rhs, |opt| opt.descending != opt.nulls_first)
+ }
+ #[deprecated(
+ since = "55.0.0",
+ note = "`AND` and `OR` propagate orderings differently under
three-valued logic; use `and` or `or`"
+ )]
pub fn and_or(&self, rhs: &Self) -> Self {
Review Comment:
I think we could remove this method entirely because this is breaking
change, downstream project need to change their code too.
@alamb What is the prefer breaking change policy now, do you think we can
remove this method and then force to change to `and` and `or` for downstream
project?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]