-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Is your feature request related to a problem? Please describe.
A olap engine always deals with time. There are time_floor and time_ceil in Druid that Doris doesn't have.
Describe the solution you'd like
I am working on it. Due to closely related to timestamp_diff, I am going to fix #4618 if no one is working on it. Plz let me know if you do.
Describe alternatives you've considered
There are two solutions.
- Accept string param represents ISO 8601 Duration, need to use regex.
- Keep the same style like
timestamp_diff, such asyear_floor. This need to generate a lot of functions to support different granularities and params overload.
I'm working on the second one. This solution provides a direct implementation. I have implemented
7(year, month, week, day, hour, minute, second) * 2(floor, ceil) * 4([timestamp], [ts, period], [ts, origin], [ts, period, origin]) = 56 functions.
period specifies the number of the time granularity, such as 3 months.
origin specifies when does the period begins, such as a MONDAY in DATETIME type, or day 09 in any month.