timescale / timescaledb-toolkit

Extension for more hyperfunctions, fully compatible with TimescaleDB and PostgreSQL 📈
https://www.timescale.com
Other
377 stars 47 forks source link

function toolkit_experimental.unnest(toolkit_experimental.timeseries) does not exist #355

Closed mulchy closed 2 years ago

mulchy commented 2 years ago

Relevant system information:

Describe the bug The unnest function doesn't exist or does not work with the timeseries type. In the docs it shows this as timevector not timeseries. Maybe this is my issue?

To Reproduce Follow directions here https://github.com/timescale/timescaledb-toolkit/blob/main/docs/lttb.md#api

DROP TABLE IF EXISTS sample_data;
SET TIME ZONE 'UTC';
CREATE TABLE sample_data(time TIMESTAMPTZ, val DOUBLE PRECISION);
INSERT INTO sample_data
    SELECT
        '2020-01-01 UTC'::TIMESTAMPTZ + make_interval(days=>(foo*10)::int) as time,
        10 + 5 * cos(foo) as val
    FROM generate_series(1,11,0.1) foo;
SELECT time, value::numeric(10,2)
FROM toolkit_experimental.unnest((
    SELECT toolkit_experimental.lttb(time, val, 34)
    FROM sample_data));

Expected behavior 34 records are returned, with 2 columns: time and value.

Actual behavior

ERROR:  42883: function toolkit_experimental.unnest(toolkit_experimental.timeseries) does not exist
LINE 2: FROM toolkit_experimental.unnest((
             ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
LOCATION:  ParseFuncOrColumn, parse_func.c:620
mulchy commented 2 years ago

Oof sorry looks like this function was added in 1.3

Screen Shot 2022-03-03 at 12 56 37 PM