DownsampledWhereFilter
The DownsampledWhereFilter
allows users to downsample time series data by calculating the bin intervals for values, and then using upperBin
and firstBy
to select the last row for each bin.
caution
The column containing the data to be binned must be sorted for the method to work.
Syntax
DownsampledWhereFilter(column, binSize)
DownsampledWhereFilter(column, binSize, order)
Parameters
Parameter | Type | Description |
---|---|---|
column | String | Instant column to use for filtering. |
binSize | long | Size in nanoseconds fo the time bins. Constants like |
order | DownsampledWhereFilter.SampleOrder | By default, this method downsamples bins by DownsampledWhereFilter.SampleOrder sets the desired behavior:
|
Returns
A DownsampledWhereFilter
that can be used in a .where
clause to downsample time series rows.
Examples
import io.deephaven.engine.table.impl.select.DownsampledWhereFilter
startTime = minus(now(), parseDuration("PT1H"))
source = timeTable(startTime, "PT1S").head(100).snapshot()
F = new DownsampledWhereFilter("Timestamp", SECOND * 30, DownsampledWhereFilter.SampleOrder.LOWERFIRST)
result = source.where(F)
- source
- result