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

Implement date_trunc() function #203

Closed
alamb opened this issue Apr 26, 2021 · 3 comments
Closed

Implement date_trunc() function #203

alamb opened this issue Apr 26, 2021 · 3 comments
Labels
datafusion Changes in the datafusion crate enhancement New feature or request

Comments

@alamb
Copy link
Contributor

alamb commented Apr 26, 2021

Note: migrated from original JIRA: https://issues.apache.org/jira/browse/ARROW-12391

Implement the date_trunc function, as described in this PostGres manual:

[https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC]

 

This would allow for the following use cases to be solved:

  • casting of timestamps to other resolutions, such as millis and micros
  • rounding dates/timestamps 

It also allows the user to explicitly allow the truncation of timestamp precision.

@alamb alamb added the datafusion Changes in the datafusion crate label Apr 26, 2021
@jwdeitch
Copy link

Looks like this was implemented in e5d1471

datafusion/src/physical_plan/datetime_expressions.rs:311

:)

@jorgecarleitao
Copy link
Member

Agreed :)

@jorgecarleitao jorgecarleitao added the enhancement New feature or request label Apr 26, 2021
@alamb
Copy link
Contributor Author

alamb commented Apr 26, 2021

Thanks @jwdeitch !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants