Hi Timescale team -
I am trying to backfill historical data into a distributed hypertable using the official documentation at:
TimescaleDB>How-to Guides>Compression>Backfill historical data
Below are the steps we’ve taken so far:
- Create a two node cluster (one access node, and one data node).
- Create a distributed hypertable named
request_logs
which is the destination of all the data to be backfilled. - Created tables (NOT
temporary table
) for each hour of the data to be backfilled. (Ex:request_logs_2022_3_3H3
) - Created the required backfill stored procedures using the backfill.sql file from
timescaledb-extras
git repository
Now, when we try to backfill the data using decompress_backfill
, we’re seeing the error below stating request_logs_2022_3_3h3
is NOT a hypertable.
Could you please suggest if the staging tables should also be hypertables? The official backfill documentation doesn’t mention anything in this regard. Is this a missing step in the documentation?
>CALL decompress_backfill(staging_table=>'request_logs_2022_3_3H3', destination_hypertable=>'request_logs');
ERROR: table "request_logs_2022_3_3h3" is not a hypertable
CONTEXT: SQL statement "
WITH to_insert AS (DELETE
FROM request_logs_2022_3_3h3 --source table
WHERE start_time >= TIMESTAMPTZ '2022-03-03 03:00:00.004106+00' -- time column >= range start
AND start_time < TIMESTAMPTZ '2022-03-03 03:59:59.993074+00' -- time column < range end
RETURNING * )
INSERT INTO request_logs
SELECT * FROM to_insert
ON CONFLICT DO NOTHING -- ON CONFLICT CLAUSE if it exists
"
PL/pgSQL function decompress_backfill(regclass,regclass,text,boolean,interval,text[],boolean) line 149 at EXECUTE