Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] time_bucket offset examples all report SQL Error with continuous aggregates #4116

Closed
SuperDaveOsbourne opened this issue Feb 21, 2022 · 1 comment

Comments

@SuperDaveOsbourne
Copy link

SuperDaveOsbourne commented Feb 21, 2022

What type of bug is this?

Unexpected error

What subsystems and features are affected?

Continuous aggregate

What happened?

Any of the examples of offset for time_bucket result in error SQL Error [XX000]: ERROR: continuous aggregate view must include a valid time bucket function.

Following the examples on the documentation pages or the online YouTube videos all result in valid bucket function errors.

Postgresql 14.1 TimescaleDb 2.51 on Windows 11.

`DROP materialized view IF exists sixty_five_mv;
create materialized view sixty_five_mv
with (timescaledb.continuous,timescaledb.create_group_indexes) as
SELECT time_bucket(interval '30m', quote_date,  TIMESTAMP '2017-12-31')  as bucket,symbol,
FIRST(open_price,quote_date) as open_price,
LAST(close_price, quote_date) as close_price,
MIN(low_price) as low_price,
MAX(high_price) as high_price,
SUM(volume) as volume,
from five_mins_ht 
group by bucket,symbol
with no data;` 

TimescaleDB version affected

2.5.1

PostgreSQL version used

14.1

What operating system did you use?

Windows 11 Version 10.0.22000.493

What installation method did you use?

Other

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

SQL Error [XX000]: ERROR: continuous aggregate view must include a valid time bucket function

How can we reproduce the bug?

No response

@SuperDaveOsbourne SuperDaveOsbourne changed the title [BUG] time_bucket examples all report SQL Error [XX000]: ERROR: continuous aggregate view must include a valid time bucket function [BUG] time_bucket offset examples all report SQL Error Feb 21, 2022
@gayyappan gayyappan removed the bug label Feb 21, 2022
@gayyappan
Copy link
Contributor

Continuous aggregates do not support time_bucket with offset.
(See supported SELECT query here)
https://docs.timescale.com/api/latest/continuous-aggregates/create_materialized_view/#create-materialized-view-continuous-aggregate

@gayyappan gayyappan changed the title [BUG] time_bucket offset examples all report SQL Error [BUG] time_bucket offset examples all report SQL Error with continuous aggregates Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants