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

WIDTH_BUCKET function support #12990

Open
vkingnew opened this issue Nov 4, 2022 · 5 comments · May be fixed by #22787
Open

WIDTH_BUCKET function support #12990

vkingnew opened this issue Nov 4, 2022 · 5 comments · May be fixed by #22787
Assignees

Comments

@vkingnew
Copy link

vkingnew commented Nov 4, 2022

function width_bucket had supported by oracle and postgresql,hive,sparksql,impala,snowflake and databricks.
please add the same name function and have the same feature.
please refer to:
https://www.postgresql.org/docs/15/functions-math.html
https://docs.snowflake.com/en/sql-reference/functions/width_bucket.html

@wangsimo0
Copy link
Contributor

@TBCCC hi could you please reply here so I can assign this to you~?

@TBCCC
Copy link
Contributor

TBCCC commented Nov 17, 2022

@TBCCC hi could you please reply here so I can assign this to you~?
OK thx

@wangsimo0 wangsimo0 assigned wangsimo0 and TBCCC and unassigned wangsimo0 Nov 25, 2022
@wangsimo0
Copy link
Contributor

wangsimo0 commented Mar 15, 2023

syntax

WIDTH_BUCKET( <expr> , <min_value> , <max_value> , <num_buckets> )

arguments

  1. expr: a numeric value
  2. min/max value: numeric value, cannot be equal, while min value can be greater than max value.
  3. num_buckets: must greater than 0.

notice

  1. when the expression is less than lower bound of the bucket, return 0
  2. when the expression is greater than upper bound of the bucket, return bucket_num+1
  3. return null if any of those arguments is null

@TBCCC TBCCC linked a pull request May 2, 2023 that will close this issue
16 tasks
@wangsimo0 wangsimo0 added the good first issue Good for newcomers label May 12, 2023
Copy link

We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!

@vkingnew
Copy link
Author

go on developing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants