Skip to content

Commit

Permalink
First commit with migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
jnidzwetzki committed Mar 14, 2024
1 parent 3303cd3 commit 28615eb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 29 deletions.
1 change: 1 addition & 0 deletions sql/pre_install/tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ CREATE TABLE _timescaledb_catalog.continuous_agg (
user_view_name name NOT NULL,
partial_view_schema name NOT NULL,
partial_view_name name NOT NULL,
bucket_width bigint NOT NULL,
direct_view_schema name NOT NULL,
direct_view_name name NOT NULL,
materialized_only bool NOT NULL DEFAULT FALSE,
Expand Down
16 changes: 5 additions & 11 deletions tsl/src/continuous_aggs/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,11 @@ caggtimebucketinfo_init(CAggTimebucketInfo *src, int32 hypertable_id, Oid hypert
src->htpartcolno = hypertable_partition_colno;
src->htpartcoltype = hypertable_partition_coltype;
src->htpartcol_interval_len = hypertable_partition_col_interval;
src->bucket_width_type = InvalidOid; /* invalid oid */

/* Time based buckets */
src->bucket_time_width = NULL; /* not specified by default */
src->bucket_time_timezone = NULL; /* not specified by default */
src->bucket_time_offset = NULL; /* not specified by default */
TIMESTAMP_NOBEGIN(src->bucket_time_origin); /* origin is not specified by default */

/* Integer based buckets */
src->bucket_integer_width = 0; /* invalid value */
src->bucket_integer_offset = 0; /* invalid value */
src->bucket_width = 0; /* invalid value */
src->bucket_width_type = InvalidOid; /* invalid oid */
src->interval = NULL; /* not specified by default */
src->timezone = NULL; /* not specified by default */
TIMESTAMP_NOBEGIN(src->origin); /* origin is not specified by default */
}

/*
Expand Down
2 changes: 0 additions & 2 deletions tsl/src/continuous_aggs/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ typedef struct CAggTimebucketInfo
int64 htpartcol_interval_len; /* interval length setting for primary partitioning column */
int64 bucket_width; /* bucket_width of time_bucket, stores BUCKET_WIDTH_VARIABLE for
variable-sized buckets */
Interval *bucket_offset; /* the offset of the bucket */
TimestampTz bucket_origin; /* the origin of the bucket */
Oid bucket_width_type; /* type of bucket_width */
Interval *interval; /* stores the interval, NULL if not specified */
const char *timezone; /* the name of the timezone, NULL if not specified */
Expand Down
16 changes: 0 additions & 16 deletions tsl/src/continuous_aggs/create.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,22 +170,6 @@ create_cagg_catalog_entry(int32 matht_id, int32 rawht_id, const char *user_schem
values[AttrNumberGetAttrOffset(Anum_continuous_agg_partial_view_name)] =
NameGetDatum(&partial_viewnm);
values[AttrNumberGetAttrOffset(Anum_continuous_agg_bucket_width)] = Int64GetDatum(bucket_width);

values[AttrNumberGetAttrOffset(Anum_continuous_agg_bucket_offset)] =
IntervalPGetDatum(bucket_offset);

if (bucket_offset != NULL)
values[AttrNumberGetAttrOffset(Anum_continuous_agg_bucket_offset)] =
IntervalPGetDatum(bucket_offset);
else
nulls[AttrNumberGetAttrOffset(Anum_continuous_agg_bucket_offset)] = true;

if (bucket_origin != CAGG_BUCKET_OFFSET_UNDEFINED)
values[AttrNumberGetAttrOffset(Anum_continuous_agg_bucket_origin)] =
TimestampTzGetDatum(bucket_origin);
else
nulls[AttrNumberGetAttrOffset(Anum_continuous_agg_bucket_origin)] = true;

values[AttrNumberGetAttrOffset(Anum_continuous_agg_direct_view_schema)] =
NameGetDatum(&direct_schnm);
values[AttrNumberGetAttrOffset(Anum_continuous_agg_direct_view_name)] =
Expand Down

0 comments on commit 28615eb

Please sign in to comment.