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

[C++][Python] Remove integer compatibility for trunc, floor and ceil #36786

Open
js8544 opened this issue Jul 20, 2023 · 2 comments
Open

[C++][Python] Remove integer compatibility for trunc, floor and ceil #36786

js8544 opened this issue Jul 20, 2023 · 2 comments

Comments

@js8544
Copy link
Collaborator

js8544 commented Jul 20, 2023

Describe the enhancement requested

Follow-up of #36289 (comment). I am in favor of removing integer compatibility for trunc, floor and ceil for the following reasons:

  1. Mathematically they are no-ops for integers, so it doesn't make much sense to support them as a function.
  2. The current implementation casts ints to floats, which may yield unexpected results due to float precision issues.
  3. It's very simple to remove it, by just deleting several lines of code, as @jorisvandenbossche mentioned here, along with some small changes in tests and docs.
  4. The support for integers was probably unintentional, just like the case for round.

The downside is, all the SQL engines, along with Numpy and R, support floor(int), and the result type is double, which means our current implementation is consistent with them.

cc @pitrou @jorisvandenbossche @westonpace

Component(s)

C++

@pitrou
Copy link
Member

pitrou commented Jul 24, 2023

I'm fine with either removing or keeping integer input support.

@jorisvandenbossche What do you think?

@js8544
Copy link
Collaborator Author

js8544 commented Aug 8, 2023

cc @jorisvandenbossche would you mind taking a look?

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