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

Feature: add DATE_TRUNC function #6528

Closed
sundy-li opened this issue Jul 7, 2022 · 5 comments · Fixed by #6540
Closed

Feature: add DATE_TRUNC function #6528

sundy-li opened this issue Jul 7, 2022 · 5 comments · Fixed by #6540
Assignees
Labels
C-feature Category: feature

Comments

@sundy-li
Copy link
Member

sundy-li commented Jul 7, 2022

Summary

Description for this feature.

To add DATE_TURNC function in planner v2, we can transform the expression in query/src/sql/planner/semantic/type_check.rs

@soyeric128
Copy link
Collaborator

Hi @sundy-li

Can you help list out which time units the first argument currently accepts?

Thanks

@sundy-li
Copy link
Member Author

#date_trunc: "`DATE_TRUNC((YEAR | MONTH | DAY | HOUR | MINUTE | SECOND | DOY | DOW), ...)

  1. DOY is day of year
  2. DOW is day of week

@sundy-li
Copy link
Member Author

Oh, there is something wrong, we don't support DOY and DOW in date_trunc. cc @ariesdevil

@ariesdevil
Copy link
Contributor

ariesdevil commented Jul 12, 2022

Oh, there is something wrong, we don't support DOY and DOW in date_trunc. cc @ariesdevil

Got, I'll fix it soon. I realized this problem but not fix all, my fault :(

@ariesdevil
Copy link
Contributor

Also, I think we need support QUARTER as well.

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

Successfully merging a pull request may close this issue.

3 participants