Add DAY_START and DAY_END as valid RANGE boundaries for window joins
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.3k
- Forks
- 1.7k
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 28
Description
Is your feature request related to a problem?
I had a conversation with Andrei about this and we are not super sure it would be useful, as we want more feedback from users, but agreed it would be interesting to add here to track interest.
Would it make sense to add, for intraday calculations, DAY_START and DAY_END as values to be used instead of PRECEDING or FOLLOWING?
SELECT a.*, avg(b.price) from a window join b ON(symbol) RANGE BETWEEN DAY_START AND 0 seconds FOLLOWING
That would give me a moving average.
Not 100% if this would be useful as I guess we could have the same doing the AVG OVER in table B on a CTE and then ASOF JOIN.
For example, not sure we can do a rolling standard deviation now. We can with a trick calculating square roots with window functions, but not straight forward. A window join from day start could calculate it
Describe the solution you'd like.
No response
Describe alternatives you've considered.
No response
Full Name:
javier
Affiliation:
questdb
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 locating the window-join RANGE boundary parsing and execution code, then review how PRECEDING and FOLLOWING are represented. Use the DAY_START and DAY_END example to define the intended semantics, add coverage for intraday moving-window calculations, and verify the resulting SQL behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100