Skip to main content
Early access 1.3.0 A timevector is an intermediate representation for efficiently storing and processing time-series data. It provides a space-efficient way to store time-value pairs and supports pipeline operations for common transformations. Timevectors are used as the return type for analytic functions like lttb() and asap_smooth(), and can be created directly from your data using the timevector() aggregate function. timevectors give you:
  • Space efficient: compact representation of time-value pairs
  • Pipeline operations: chain transformations using the -> operator
  • Flexible aggregation: create from raw data or combine existing timevectors
  • Easy extraction: use unnest() to convert back to rows

Samples

Create and query a timevector

This example creates a timevector from time-series data and extracts the values:

Use timevector with downsampling

Timevectors work seamlessly with downsampling functions:

Combine multiple timevectors

Use rollup() to combine timevectors from different groups:

Timevector pipelines

Timevectors support pipeline operations using the -> operator. This allows you to chain transformations:
Common pipeline elements include:
  • sort(): Sort points by timestamp
  • delta(): Calculate differences between consecutive values
  • lttb(resolution): Downsample using LTTB algorithm
Pipeline operations can be grouped with parentheses for optimization:

Available functions

Aggregate functions

Accessor functions

  • unnest(): extract time-value pairs from a timevector