Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagation of ordered SortProperties should consider nulls_first #11596

Open
jonahgao opened this issue Jul 22, 2024 · 0 comments
Open

Propagation of ordered SortProperties should consider nulls_first #11596

jonahgao opened this issue Jul 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jonahgao
Copy link
Member

jonahgao commented Jul 22, 2024

Describe the bug

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.

For example, as pointed out by @2010YOUY01 in #11571 (comment)

Looks like the following logic is not completely correct 🤔 e.g. base is DESC NULLS FIRST num is ASC NULLS LAST This implementation will return log(base, num) is ASC NULLS LAST But the actual output might look like

NULL
NULL
1
2
NULL

Which is unordered.

To Reproduce

Need to examine the code.

  • The methods of SortProperties, such as add, sub, seem to not consider nulls_first.
  • Similar to log.rs (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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant