wangyum opened a new pull request #18323: URL: https://github.com/apache/spark/pull/18323
## What changes were proposed in this pull request? Add build-in SQL function - `WIDTH_BUCKET` Ref: https://docs.oracle.com/cd/B28359_01/olap.111/b28126/dml_functions_2137.htm#OLADM717 ## How was this patch tested? unit tests and manual tests. manual tests(compare `spark-sql` results with `oracle`): ```sql select width_bucket(5.35, 0.024, 10.06, 5) from dual; -- 3 -- select width_bucket(3.14, 0, 4, 3) from dual; -- 3 -- select width_bucket(2, 0, 4, 3) from dual; -- 2 -- select width_bucket(-1, 0, 3.2, 4) from dual; -- 0 -- select width_bucket(3.14, 4, 0, 3) from dual; -- 1 -- select width_bucket(2, 4, 0, 3) from dual; -- 2 -- select width_bucket(-1, 3.2, 0, 4) from dual; -- 5 -- ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
