docs(sql): SAMPLE BY FILL - cross-column references for prev, fast-path and limitations#426
Open
jovfer wants to merge 2 commits into
Open
docs(sql): SAMPLE BY FILL - cross-column references for prev, fast-path and limitations#426jovfer wants to merge 2 commits into
jovfer wants to merge 2 commits into
Conversation
Update the SAMPLE BY reference and the related cookbook recipes to match what the FILL fast path now accepts: - sample-by.md: list PREV(col) in the FILL options table, replace the outdated "fill strategies cannot be combined" rule with the actual PREV(col) and FILL(NONE) constraints, and rewrite the FROM-TO Limitations to drop "not compatible with FILL(PREV)" and "does not consider OFFSET". Note that keyed FROM-TO is supported when FROM/TO are constants and is rejected for bind-variable / function / arithmetic bounds. - fill-keyed-arbitrary-interval.md: scope the recipe to the bind-variable / function-bound case, since constant-bound keyed FROM-TO works natively. - fill-from-one-column.md: replace the "imagine this SQL was valid" framing with the actual FILL(PREV(col)) syntax and keep the window- function rewrite as the more flexible alternative for cases such as flagging filled rows.
|
🚀 Build success! Latest successful preview: https://preview-426--questdb-documentation.netlify.app/docs/ Commit SHA: f0df257
|
javier
reviewed
May 8, 2026
| (= `2025-12-31T23:00:00Z` UTC). | ||
|
|
||
| `FROM-TO` can only be used on non-keyed SAMPLE BY queries (queries with no grouping columns other than the timestamp). | ||
| `FROM-TO` works with both non-keyed and keyed `SAMPLE BY` queries. Keyed queries emit one row per (bucket, key) combination across the full interval. Keyed `FROM-TO` requires `FROM`/`TO` to be constants; bind variables, function calls, or arithmetic expressions are rejected with _FROM-TO intervals are not supported for keyed SAMPLE BY queries_. |
Collaborator
There was a problem hiding this comment.
I think there is some punctuation problem here. I am not sure which the restrictions are
Contributor
Author
There was a problem hiding this comment.
it's poor formatting, anyway I'll delete the 3rd sentence here to avoid duplication with limitation sections as suggested below.
javier
requested changes
May 8, 2026
Collaborator
javier
left a comment
There was a problem hiding this comment.
Small comments, but otherwise ready to go
| - Only works with `ALIGN TO CALENDAR` (default alignment). | ||
| - Does not consider any specified `OFFSET`. | ||
| - Only for non-keyed `SAMPLE BY` (designated timestamp and aggregate columns only). See [Fill keyed queries with arbitrary intervals](/docs/cookbook/sql/time-series/fill-keyed-arbitrary-interval/) for a workaround. | ||
| - Keyed `FROM-TO` requires `FROM`/`TO` to be constants. Bind variables, |
Collaborator
There was a problem hiding this comment.
This is exactly the same we said above. I would keept it here under limitations, and would remove from aboive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refresh the SAMPLE BY FILL documentation to reflect what the fast-path implementation in questdb/questdb#6946 now accepts.
query/sql/sample-by.mdPREV(col)to the FILL options table and list its constraints (type match, no broadcast, no SYMBOL).FILL(NONE)rule.cookbook/sql/time-series/fill-keyed-arbitrary-interval.mdcookbook/sql/time-series/fill-from-one-column.mdFILL(PREV(col))syntax. Keep the window-function rewrite as the flexible alternative (e.g. flagging filled rows).Test plan
#from-to,#fill-options) still resolve.