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

alias round_digit to round #17982

Closed
kwannoel opened this issue Aug 9, 2024 · 2 comments
Closed

alias round_digit to round #17982

kwannoel opened this issue Aug 9, 2024 · 2 comments

Comments

@kwannoel
Copy link
Contributor

kwannoel commented Aug 9, 2024

To be compatible with pg. https://www.postgresql.org/docs/current/functions-math.html

@github-actions github-actions bot added this to the release-2.0 milestone Aug 9, 2024
@xiangjinwu
Copy link
Contributor

Could you elaborate? round_digit is the internal name and round is the user-facing SQL name.

(
"round",
dispatch_by_len(vec![
(2, raw_call(ExprType::RoundDigit)),
(1, raw_call(ExprType::Round)),
]),
),

@kwannoel
Copy link
Contributor Author

Nevermind, seems like it's an issue on my part.

dev=> create table t(p_col double, grp_col int);
CREATE_TABLE
dev=> select round(sum(p_col), 2) from t;
ERROR:  Failed to run the query

Caused by these errors (recent errors listed first):
  1: Failed to bind expression: round(sum(p_col), 2)
  2: function round_digit(double precision, integer) does not exist

dev=> select round(sum(p_col)::numeric, 2) from t;
 round 
-------
      
(1 row)


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

No branches or pull requests

2 participants