-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Relevant system information:
- OS: Ubuntu 22.04
- PostgreSQL version (output of
SELECT version();
): 14.5 - TimescaleDB Toolkit version (output of
\dx timescaledb_toolkit
inpsql
): 1.11.0 - Installation method: "Timescale Cloud"
Describe the bug
Running the same query involving OHLC returns different results from run to run.
To Reproduce
Query involving more than one company:
SELECT time_bucket('1 hour'::interval, "time") AS ts,
symbol,
toolkit_experimental.open(toolkit_experimental.ohlc("time", price))
FROM stocks_real_time
GROUP BY ts, symbol;
- The same opening price is returned for different companies, which is just wrong.
- Different opening prices are returned from the same company from run to run.
Query involving only one company:
SELECT time_bucket('1 hour'::interval, "time") AS ts,
symbol,
toolkit_experimental.open(toolkit_experimental.ohlc("time", price))
FROM stocks_real_time
WHERE symbol IN ('AAPL')
GROUP BY ts, symbol;
Even restricting the query to just one company, from run to run, different opening prices are returned for the same time.
Additional context
Reported initially by @zseta , If no accessor (toolkit_experimental.open()
) is specified, this query
SELECT time_bucket('1 minute'::interval, "time") AS ts,
symbol,
toolkit_experimental.ohlc("time", price)
FROM stocks_real_time
GROUP BY ts, symbol;
returns error:
ERROR: timestamp out of range
CONTEXT: extension/src/serialization.rs:39:13
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working