From d9428ce9b4d67bb90eda66cef5087f5a7ea28209 Mon Sep 17 00:00:00 2001 From: Marko Topolnik Date: Fri, 22 May 2026 15:54:56 +0200 Subject: [PATCH 1/2] Document twap() designated-timestamp limitation The twap() page said the timestamp argument could be any timestamp column. twap() now rejects anything other than the table's designated timestamp, because it relies on its observations already being in ascending designated-timestamp order. Update the parameter description to state this, framed as a current limitation. Co-Authored-By: Claude Opus 4.7 (1M context) --- documentation/query/functions/aggregation.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/documentation/query/functions/aggregation.md b/documentation/query/functions/aggregation.md index 302998f8c..a954f3c27 100644 --- a/documentation/query/functions/aggregation.md +++ b/documentation/query/functions/aggregation.md @@ -1659,9 +1659,10 @@ Supports `SAMPLE BY` with `FILL` modes. #### Parameters - `price` is any numeric value. -- `timestamp` is a `timestamp` value. This is typically the table's - [designated timestamp](/docs/concepts/designated-timestamp/) but can be any - timestamp column. +- `timestamp` must be the table's + [designated timestamp](/docs/concepts/designated-timestamp/). As a current + limitation, `twap()` rejects a query that passes any other timestamp column + or expression. #### Return value From be8b95137ed35b677ba66d8c7d54320ad9a18aa0 Mon Sep 17 00:00:00 2001 From: Marko Topolnik Date: Thu, 28 May 2026 09:40:17 +0200 Subject: [PATCH 2/2] Align wording between twap and sparkline --- documentation/query/functions/aggregation.md | 8 +++++--- documentation/query/functions/visualization.md | 6 ++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/documentation/query/functions/aggregation.md b/documentation/query/functions/aggregation.md index a954f3c27..f1828ad0f 100644 --- a/documentation/query/functions/aggregation.md +++ b/documentation/query/functions/aggregation.md @@ -1660,9 +1660,11 @@ Supports `SAMPLE BY` with `FILL` modes. - `price` is any numeric value. - `timestamp` must be the table's - [designated timestamp](/docs/concepts/designated-timestamp/). As a current - limitation, `twap()` rejects a query that passes any other timestamp column - or expression. + [designated timestamp](/docs/concepts/designated-timestamp/), and the base + query must deliver rows in ascending designated-timestamp order. As a + current limitation, `twap()` rejects a query that passes any other + timestamp column or expression, or a base scan that compiles to a backward + scan (for example, an inner `ORDER BY ts DESC LIMIT N`). #### Return value diff --git a/documentation/query/functions/visualization.md b/documentation/query/functions/visualization.md index 7ddb12c67..38138122a 100644 --- a/documentation/query/functions/visualization.md +++ b/documentation/query/functions/visualization.md @@ -241,6 +241,12 @@ When explicit `min`/`max` are provided, out-of-range values are clamped: `FILL(NULL)`, `FILL(NONE)`, and `FILL(PREV)`. `FILL(LINEAR)` and `FILL(value)` are not supported. +- **Ascending designated-timestamp scan required.** The base query must + deliver rows in ascending designated-timestamp order. As a current + limitation, `sparkline` rejects a base scan that compiles to a backward + scan (for example, an inner `ORDER BY ts DESC LIMIT N` on the + [designated timestamp](/docs/concepts/designated-timestamp/)). + #### See also - [bar](#bar) - Scalar horizontal bar