Skip to content

Commit

Permalink
Version 3
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziomello committed Dec 12, 2024
1 parent 814754f commit 5375c05
Show file tree
Hide file tree
Showing 10 changed files with 1,468 additions and 1,538 deletions.
3 changes: 1 addition & 2 deletions test/expected/drop_rename_hypertable.out
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ SELECT * FROM _timescaledb_catalog.hypertable;
_timescaledb_catalog | continuous_agg | table | super_user
_timescaledb_catalog | continuous_agg_migrate_plan | table | super_user
_timescaledb_catalog | continuous_agg_migrate_plan_step | table | super_user
_timescaledb_catalog | continuous_aggs_bucket_function | table | super_user
_timescaledb_catalog | continuous_aggs_hypertable_invalidation_log | table | super_user
_timescaledb_catalog | continuous_aggs_invalidation_threshold | table | super_user
_timescaledb_catalog | continuous_aggs_materialization_invalidation_log | table | super_user
Expand All @@ -215,7 +214,7 @@ SELECT * FROM _timescaledb_catalog.hypertable;
_timescaledb_catalog | metadata | table | super_user
_timescaledb_catalog | tablespace | table | super_user
_timescaledb_catalog | telemetry_event | table | super_user
(21 rows)
(20 rows)

\dt "_timescaledb_internal".*
List of relations
Expand Down
22 changes: 10 additions & 12 deletions tsl/src/continuous_aggs/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,12 @@ build_const_value_for_origin(TimeBucketInfoContext *context, Oid origin_type)
case TIMESTAMPOID:
const_datum =
DirectFunctionCall1(timestamptz_timestamp,
TimestampTzGetDatum(
context->bucket_time_origin_to_replace));
TimestampTzGetDatum(context->bucket_time_origin_to_replace));
break;
case DATEOID:
const_datum =
DirectFunctionCall1(timestamptz_date,
TimestampTzGetDatum(
context->bucket_time_origin_to_replace));
TimestampTzGetDatum(context->bucket_time_origin_to_replace));
break;
default:
elog(ERROR,
Expand Down Expand Up @@ -462,13 +460,13 @@ continuous_agg_replace_function(ContinuousAgg *cagg, Oid function_to_replace,
TimestampTz bucket_time_origin_to_replace,
bool need_parameter_order_change)
{
TimeBucketInfoContext context = {
.cagg = cagg,
.function_to_replace = function_to_replace,
.origin_added_during_migration = origin_added_during_migration,
.bucket_time_origin_to_replace = bucket_time_origin_to_replace,
.need_parameter_order_change = need_parameter_order_change
};
TimeBucketInfoContext context = { .cagg = cagg,
.function_to_replace = function_to_replace,
.origin_added_during_migration =
origin_added_during_migration,
.bucket_time_origin_to_replace =
bucket_time_origin_to_replace,
.need_parameter_order_change = need_parameter_order_change };

/* Rewrite the direct_view */
Oid direct_view_oid = ts_get_relation_relid(NameStr(cagg->data.direct_view_schema),
Expand Down Expand Up @@ -598,7 +596,7 @@ continuous_agg_migrate_to_time_bucket(PG_FUNCTION_ARGS)
/* Update the time_bucket_fuction */
cagg->bucket_function->bucket_function = new_bucket_function;
bool origin_added_during_migration = false;
TimestampTz bucket_time_origin_to_replace;
TimestampTz bucket_time_origin_to_replace = 0;

/* Set new origin if not already present in the function definition. This is needed since
* time_bucket and time_bucket_ng use different origin default values.
Expand Down
432 changes: 211 additions & 221 deletions tsl/test/expected/cagg_query-14.out

Large diffs are not rendered by default.

432 changes: 211 additions & 221 deletions tsl/test/expected/cagg_query-15.out

Large diffs are not rendered by default.

432 changes: 211 additions & 221 deletions tsl/test/expected/cagg_query-16.out

Large diffs are not rendered by default.

432 changes: 211 additions & 221 deletions tsl/test/expected/cagg_query-17.out

Large diffs are not rendered by default.

416 changes: 203 additions & 213 deletions tsl/test/expected/cagg_query_using_merge-15.out

Large diffs are not rendered by default.

416 changes: 203 additions & 213 deletions tsl/test/expected/cagg_query_using_merge-16.out

Large diffs are not rendered by default.

416 changes: 203 additions & 213 deletions tsl/test/expected/cagg_query_using_merge-17.out

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion tsl/test/sql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,12 @@ if((${PG_VERSION_MAJOR} GREATER_EQUAL "15"))
merge_compress.sql)
endif()

if((${PG_VERSION_MAJOR} GREATER_EQUAL "15"))
list(APPEND TEST_TEMPLATES cagg_query_using_merge.sql.in)
endif()

if((${PG_VERSION_MAJOR} GREATER_EQUAL "16"))
list(APPEND TEST_FILES cagg_planning.sql hypercore_parallel.sql)
list(APPEND TEST_TEMPLATES cagg_query_using_merge.sql.in)
endif()

if((${PG_VERSION_MAJOR} GREATER_EQUAL "17"))
Expand Down

0 comments on commit 5375c05

Please sign in to comment.