-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent usage of time_bucket_ng in CAgg definition
The function timescaledb_experimental.time_bucket_ng() has been deprecated for two years. This PR removes it from the list of bucketing functions supported in a CAgg. Existing CAggs using this function will still be supported; however, no new CAggs using this function can be created.
- Loading branch information
1 parent
8d9b062
commit 380feff
Showing
21 changed files
with
223 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Implements: #6798 Prevent usage of deprecated time_bucket_ng in CAgg definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
-- This file and its contents are licensed under the Timescale License. | ||
-- Please see the included NOTICE for copyright information and | ||
-- LICENSE-TIMESCALE for a copy of the license. | ||
CREATE TABLE conditions( | ||
time timestamptz NOT NULL, | ||
city text NOT NULL, | ||
temperature INT NOT NULL); | ||
SELECT create_hypertable( | ||
'conditions', 'time', | ||
chunk_time_interval => INTERVAL '1 day' | ||
); | ||
create_hypertable | ||
------------------------- | ||
(1,public,conditions,t) | ||
(1 row) | ||
|
||
-- Ensure no CAgg using time_bucket_ng can be created | ||
\set ON_ERROR_STOP 0 | ||
-- Regular CAgg | ||
CREATE MATERIALIZED VIEW conditions_summary_weekly | ||
WITH (timescaledb.continuous, timescaledb.materialized_only=false) AS | ||
SELECT city, | ||
timescaledb_experimental.time_bucket_ng('7 days', time, 'UTC') AS bucket, | ||
MIN(temperature), | ||
MAX(temperature) | ||
FROM conditions | ||
GROUP BY city, bucket WITH NO DATA; | ||
ERROR: experimental bucket functions are not supported inside a CAgg definition | ||
-- CAgg with origin | ||
CREATE MATERIALIZED VIEW conditions_summary_weekly | ||
WITH (timescaledb.continuous, timescaledb.materialized_only=false) AS | ||
SELECT city, | ||
timescaledb_experimental.time_bucket_ng('7 days', time, '2024-01-16 18:00:00+00') AS bucket, | ||
MIN(temperature), | ||
MAX(temperature) | ||
FROM conditions | ||
GROUP BY city, bucket WITH NO DATA; | ||
ERROR: experimental bucket functions are not supported inside a CAgg definition | ||
-- CAgg with origin and timezone | ||
CREATE MATERIALIZED VIEW conditions_summary_weekly | ||
WITH (timescaledb.continuous, timescaledb.materialized_only=false) AS | ||
SELECT city, | ||
timescaledb_experimental.time_bucket_ng('7 days', time, '2024-01-16 18:00:00+00', 'UTC') AS bucket, | ||
MIN(temperature), | ||
MAX(temperature) | ||
FROM conditions | ||
GROUP BY city, bucket WITH NO DATA; | ||
ERROR: experimental bucket functions are not supported inside a CAgg definition | ||
\set ON_ERROR_STOP 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.