Skip to content

Conversation

@xiangjinwu
Copy link
Contributor

@xiangjinwu xiangjinwu commented May 24, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

These are the overloads in PostgreSQL:

name args ret status
trunc double precision double precision this PR
trunc numeric numeric this PR
trunc numeric, int numeric future PR
ln double precision double precision this PR
ln numeric numeric this PR
log10 double precision double precision this PR
log10 numeric numeric this PR
log double precision double precision this PR
log numeric numeric this PR
log numeric, numeric numeric future PR
exp double precision double precision existing
exp numeric numeric this PR
cbrt double precision double precision this PR
sqrt double precision double precision existing
sqrt numeric numeric existing

Note that:

  • This PR only handles the unary form. The binary form of trunc(numeric, int) and log(numeric, numeric) are deferred to later PRs. The binary form only handles numeric.
  • exp for double precision has been added in an earlier PR. This PR adds its missing numeric form.
  • cbrt only exists for double precision, although sqrt exists for both.
  • Types not in the list may be implicitly casted, for example pg_typeof(cbrt(1::decimal)) returns double precision.

Checklist For Contributors

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

Types of user-facing changes

  • SQL commands, functions, and operators

Release note

support unary trunc, ln, log10 (log), exp, cbrt (||/)

@github-actions github-actions bot added type/feature Type: New feature. user-facing-changes Contains changes that are visible to users labels May 24, 2023
@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #9991 (0391db3) into main (c002dff) will decrease coverage by 0.03%.
The diff coverage is 16.04%.

@@            Coverage Diff             @@
##             main    #9991      +/-   ##
==========================================
- Coverage   71.08%   71.06%   -0.03%     
==========================================
  Files        1251     1251              
  Lines      209561   209642      +81     
==========================================
+ Hits       148974   148983       +9     
- Misses      60587    60659      +72     
Flag Coverage Δ
rust 71.06% <16.04%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/common/src/types/decimal.rs 74.56% <0.00%> (-4.70%) ⬇️
src/frontend/src/binder/expr/mod.rs 78.33% <0.00%> (-0.18%) ⬇️
src/frontend/src/expr/pure.rs 95.00% <ø> (ø)
src/expr/src/vector_op/exp.rs 66.27% <15.62%> (-30.02%) ⬇️
src/expr/src/vector_op/arithmetic_op.rs 71.23% <25.00%> (-0.42%) ⬇️
src/expr/src/vector_op/round.rs 92.50% <25.00%> (-7.50%) ⬇️
src/frontend/src/binder/expr/function.rs 88.36% <100.00%> (+0.08%) ⬆️

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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

Labels

type/feature Type: New feature. user-facing-changes Contains changes that are visible to users 📖✓ Covered or will be covered in the user docs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants