diff --git a/documentation/query/functions/aggregation.md b/documentation/query/functions/aggregation.md index 302998f8c..cad66d76b 100644 --- a/documentation/query/functions/aggregation.md +++ b/documentation/query/functions/aggregation.md @@ -1659,9 +1659,14 @@ 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/), and the base + query must deliver rows in ascending designated-timestamp order. `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`). To use a non-designated timestamp column, first + promote it to designated timestamp using the + [timestamp function](/docs/query/functions/timestamp/). #### Return value diff --git a/documentation/query/functions/visualization.md b/documentation/query/functions/visualization.md index 7ddb12c67..1db280e9c 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. `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