-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
builtins: add width_bucket builtin function #38855
Comments
I'll take on this |
@Inconnu08 great! Do let me know if you need pointers. |
@jordanlewis Hi! What is the actual status of this issue? |
@Russiancold Hey, I'm still working on this. But I'll let you know if I can't. :) |
@Inconnu08 Alright |
Hope you don't mind, but I took a stab at this since there wasn't much movement on it. #39263 @jordanlewis One thing I was unsure of is if it is necessary to have the overload for Numeric and Decimal? I created an overload for decimal and have been unable to find a situation where it doesn't work. |
Implements the width_bucket() builtin function Details on the Postgres implementation can be found here: https://www.postgresql.org/docs/11/functions-math.html Resolves cockroachdb#38855 Release note (sql change): add the width_bucket builtin function.
Ahh, I was almost halfway there. Stuck with the tests. Hence I didn't PR until completely done. But it's completely fine. :) |
Implements the width_bucket() builtin function Details on the Postgres implementation can be found here: https://www.postgresql.org/docs/11/functions-math.html Resolves cockroachdb#38855 Release note (sql change): add the width_bucket builtin function.
Implements the width_bucket() builtin function Details on the Postgres implementation can be found here: https://www.postgresql.org/docs/11/functions-math.html Resolves cockroachdb#38855 Release note (sql change): add the width_bucket builtin function.
39263: sql: add width_bucket builtin r=jordanlewis a=barbourkd Implements the width_bucket() builtin function Details on the Postgres implementation can be found here: https://www.postgresql.org/docs/11/functions-math.html Resolves #38855 Release note (sql change): add the width_bucket builtin function. Co-authored-by: Kevin Barbour <barbourkd@vcu.edu> Co-authored-by: Kevin <kevinbarbourd@gmail.com>
The
width_bucket
builtin is a super useful function that figures out where a number lies inside of a histogram given certain parameters.We should implement these. It's a pretty simple task that will boost compatibility (and help make
ALTER TABLE SPLIT BY
a lot easier to run).This is a great issue for new contributors. The implementation of this builtin (well, each of its 3 overloads defined in the Postgres docs below) should live in
pkg/sql/sem/builtins/builtins.go
.https://www.postgresql.org/docs/11/functions-math.html
The text was updated successfully, but these errors were encountered: