Skip to content

Commit

Permalink
Update the initial event and span db tables
Browse files Browse the repository at this point in the history
  • Loading branch information
goetzrrGit committed Jul 15, 2024
1 parent 2c310e5 commit 9ccbc51
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ create table merlin.event (

value jsonb,
topic_index integer not null,
span_id integer,

constraint event_natural_key
primary key (dataset_id, real_time, transaction_index, causal_time)
Expand All @@ -26,6 +27,8 @@ comment on column merlin.event.value is e''
'The value of this event as a json blob';
comment on column merlin.event.topic_index is e''
'The topic of this event';
comment on column merlin.event.span_id is e''
'The span of this event';

create function merlin.event_integrity_function()
returns trigger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
create table merlin.span (
id integer generated always as identity,
span_id integer not null,

dataset_id integer not null,
parent_id integer null,
Expand All @@ -9,17 +9,18 @@ create table merlin.span (
type text not null,
attributes jsonb not null,


constraint span_synthetic_key
primary key (dataset_id, id)
primary key (dataset_id, span_id)
)
partition by list (dataset_id);

comment on table merlin.span is e''
'A temporal window of interest. A span may be refined by its children, providing additional information over '
'more specific windows.';

comment on column merlin.span.id is e''
'The synthetic identifier for this span.';
comment on column merlin.span.span_id is e''
'The id for this span.';
comment on column merlin.span.dataset_id is e''
'The dataset this span is part of.';
comment on column merlin.span.parent_id is e''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
create view merlin.simulated_activity as
(
select span.id as id,
select span.span_id as id,
sd.id as simulation_dataset_id,
span.parent_id as parent_id,
span.start_offset as start_offset,
Expand Down

0 comments on commit 9ccbc51

Please sign in to comment.