jonahgao opened a new issue, #11596: URL: https://github.com/apache/datafusion/issues/11596
### Describe the bug As pointed by @2010YOUY01 in https://github.com/apache/datafusion/pull/11571#discussion_r1685702554 For binary expressions or multi-input functions , if their args are ordered but the `nulls_first` option in `SortOptions` differs, they are still very likely to be unordered. ### To Reproduce Need to examine the code. - The methods of `SortProperties`, such as [add](https://github.com/apache/datafusion/blob/81d06f2e103385fe744fb909563d4fb4c4b13d49/datafusion/expr/src/sort_properties.rs#L48), `sub`, seem to not consider nulls_first. - Similar to [log.rs](https://github.com/apache/datafusion/blob/81d06f2e103385fe744fb909563d4fb4c4b13d49/datafusion/functions/src/math/log.rs#L84) (should be fixed in PR 11571), the implementation of `ScalarUDFImpl::output_ordering` also needs to be reviewed. ### Expected behavior _No response_ ### Additional context _No response_ -- 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: github-unsubscr...@datafusion.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org