Timestamp Generator with Intervals
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.3k
- Forks
- 1.6k
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 28
Description
Is your feature request related to a problem?
Currently, the only way to generate a timestamp series is by using a base timestamp and a long type for a step. Current way of generating timestamps:
SELECT x, timestamp_sequence(to_timestamp('2019-10-17T00:00:00', 'yyyy-MM-ddTHH:mm:ss'), 100000L)
This is a problem when I need to generate a weekly or monthly series.
Describe the solution you'd like.
The solution would be similar to this:
GENERATE_DATE_ARRAY(DATE('2020-01-01'), CURRENT_DATE(), INTERVAL 1 DAY)
ideally would look something more QuestDB-y.
timestamp_sequence(ts, 1M)
Describe alternatives you've considered.
There is a hacky way to get around this with selecting a min, max union then sample by INTERVAL with FILL.
Additional context.
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing timestamp_sequence function mentioned in the issue and review how timestamp steps are currently represented. Define the expected behavior for weekly and monthly intervals, including the proposed timestamp_sequence(ts, 1M) form, then add coverage for the requested interval cases and confirm the generated series matches the specified bounds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100