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

Support float arguments to to_timestamp function #7868

Closed
Tracked by #3148
alamb opened this issue Oct 19, 2023 · 5 comments · Fixed by #8159
Closed
Tracked by #3148

Support float arguments to to_timestamp function #7868

alamb opened this issue Oct 19, 2023 · 5 comments · Fixed by #8159
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@alamb
Copy link
Contributor

alamb commented Oct 19, 2023

Is your feature request related to a problem or challenge?

In #7844 we are (about to) change to_timestamp to be aligned with postgres by taking seconds instead of milliseconds.

To fully align with postgres, we should also add support double (Float64) arguments as well

The postgres documentation for to_timestamp is here

Describe the solution you'd like

I would like the to_timestamp function to also support Float64 point arguments:

For example, (not the 1.1 at the end of the timestamp)

willy=# select to_timestamp(1.1);
       to_timestamp       
--------------------------
 1970-01-01 08:00:01.1+08

Describe alternatives you've considered

No response

Additional context

Note the string / two argument version of to_timestamp is covered by #5398

@spaydar
Copy link
Contributor

spaydar commented Oct 19, 2023

I'll work on this

@alamb
Copy link
Contributor Author

alamb commented Oct 20, 2023

Thanks @spaydar -- note that we haven't merged #7844 yet, so you probably would need to start from that branch if you want to work on this prior to when @comphead merges

@edmondop
Copy link
Contributor

Is this still up for grab?

@spaydar
Copy link
Contributor

spaydar commented Nov 14, 2023

I'm still working on this; it's been a bit more involved than I expected. Is this blocking other issues?

@comphead
Copy link
Contributor

comphead commented Nov 14, 2023

No blocking issues as of now, rather this is one of the missing pieces for timestamp.
But I would not hurry with that, its tightly connected with some issues from #7958 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants