influxdata / influxdata/influxdb
Feature Request: DatePart in InfluxQL
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
Can we have InfluxQL support DatePart which is supported in almost all SQL engines? The use case is to analyze long term trend over a wide time scale, but only part of the range.
Example use cases.
1. Server utilization during business hours, we will have a data point at every 10 seconds, but we want to trend business hour vs non business hour utilization
2. Data/requests/hit volume on first of the month over time, we can always have a grafana plot the entire timescale, but that kind of overloads the analysis, I rather have a graph where I can compare 1st of every month data over last 10 years.
Proposal:
Have support for DatePart with only one argument (as we have the timescale as fixed argument), which will apply the filter on the timescale.
e.g. Select \* from Host_Metrics where DatePart(hour)>8 and DatePart(hour)<17
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 with the proposed InfluxQL DatePart(hour) syntax and the two time-range examples in this issue. Review the 38-comment discussion for the unresolved behavior and design constraints. Done means agreeing on the supported DatePart semantics and implementing and validating the feature in the relevant query path, though no files or tests are named here.
Written by the indexing model from the issue text.
Assessment
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100