andygrove opened a new issue, #11557: URL: https://github.com/apache/datafusion/issues/11557
### Describe the bug In Postgres and Apache Spark, `signum` returns -1 for negative numbers, 0 for zero, and 1 for positive numbers. DataFusion uses Rust's signum function, which has different behavior. ``` ❯ select signum(-1), signum(0), signum(1); +-------------------+------------------+------------------+ | signum(Int64(-1)) | signum(Int64(0)) | signum(Int64(1)) | +-------------------+------------------+------------------+ | -1.0 | 1.0 | 1.0 | +-------------------+------------------+------------------+ ``` We should implement our own implementation of signum. ### To Reproduce _No response_ ### 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: [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]
