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

SQL: add DATE_TRUNC function #46319

Closed
astefan opened this issue Sep 4, 2019 · 6 comments · Fixed by #46473
Closed

SQL: add DATE_TRUNC function #46319

astefan opened this issue Sep 4, 2019 · 6 comments · Fixed by #46473
Assignees
Labels

Comments

@astefan
Copy link
Contributor

astefan commented Sep 4, 2019

The DATE_TRUNC function is used to truncate date/datetimes to specified precision.
https://www.w3resource.com/PostgreSQL/date_trunc-function.php

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@jbonn360
Copy link
Contributor

jbonn360 commented Sep 4, 2019

@astefan does this need approval? I can work on this

@astefan
Copy link
Contributor Author

astefan commented Sep 5, 2019

@jbonn360 thank you for your interest in ES-SQL. We do appreciate it.
We've already started looking at this implementation and it's not that trivial. If you maybe would like to have a look at a more simple issue to start with, that would be preferable.

@jbonn360
Copy link
Contributor

jbonn360 commented Sep 5, 2019

@astefan ok cheers

@matriv matriv self-assigned this Sep 8, 2019
matriv added a commit to matriv/elasticsearch that referenced this issue Sep 8, 2019
DATE_TRUNC(<truncate field>, <date/datetime>) is a function that allows
the user to truncate a timestamp to the specified field by zeroing out
the rest of the fields. The function is implemented according to the
spec from PostgreSQL: https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC

Closes: elastic#46319
matriv added a commit that referenced this issue Sep 11, 2019
DATE_TRUNC(<truncate field>, <date/datetime>) is a function that allows
the user to truncate a timestamp to the specified field by zeroing out
the rest of the fields. The function is implemented according to the
spec from PostgreSQL: https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC

Closes: #46319
@matriv
Copy link
Contributor

matriv commented Sep 11, 2019

@jbonn360 Once again, thank you for your interest to contribute to our project.
If you'd like you could give a go on a functionality extension of DATE_TRUNC to include intervals: #46632

matriv added a commit that referenced this issue Sep 11, 2019
DATE_TRUNC(<truncate field>, <date/datetime>) is a function that allows
the user to truncate a timestamp to the specified field by zeroing out
the rest of the fields. The function is implemented according to the
spec from PostgreSQL: https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC

Closes: #46319
(cherry picked from commit b37e967)
@matriv
Copy link
Contributor

matriv commented Sep 11, 2019

master : b37e967
7.x : d956509

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

Successfully merging a pull request may close this issue.

4 participants