Skip to content

Commit

Permalink
Update seed executions with compile completed at/query started at
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelGFagan committed Aug 16, 2022
1 parent 85e6868 commit a8ebe2d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions macros/create_seed_executions_table_if_not_exists.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@
create table {{database_name}}.{{schema_name}}.{{table_name}} (
command_invocation_id STRING,
node_id STRING,
run_started_at TIMESTAMP_TZ,
run_started_at TIMESTAMP_NTZ,
was_full_refresh BOOLEAN,
thread_id STRING,
status STRING,
compile_started_at TIMESTAMP_TZ,
query_completed_at TIMESTAMP_TZ,
compile_started_at TIMESTAMP_NTZ,
compile_completed_at TIMESTAMP_NTZ,
query_started_at TIMESTAMP_NTZ,
query_completed_at TIMESTAMP_NTZ,
total_node_runtime INTEGER,
rows_affected INTEGER,
materialization STRING,
Expand All @@ -64,6 +66,8 @@
thread_id STRING,
status STRING,
compile_started_at TIMESTAMP,
compile_completed_at TIMESTAMP,
query_started_at TIMESTAMP,
query_completed_at TIMESTAMP,
total_node_runtime INTEGER,
rows_affected INTEGER,
Expand Down
6 changes: 6 additions & 0 deletions macros/upload_seed_executions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,26 @@
{% for stage in model.timing if stage.name == "compile" %}
{% if loop.length == 0 %}
null, {# compile_started_at #}
null, {# compile_completed_at #}
{% else %}
'{{ stage.started_at }}', {# compile_started_at #}
'{{ stage.completed_at }}', {# compile_completed_at #}
{% endif %}
{% endfor %}

{% for stage in model.timing if stage.name == "execute" %}
{% if loop.length == 0 %}
null, {# query_started_at #}
null, {# query_completed_at #}
{% else %}
'{{ stage.started_at }}', {# query_started_at #}
'{{ stage.completed_at }}', {# query_completed_at #}
{% endif %}
{% endfor %}
{% else %}
null, {# compile_started_at #}
null, {# compile_completed_at #}
null, {# query_started_at #}
null, {# query_completed_at #}
{% endif %}

Expand Down

0 comments on commit a8ebe2d

Please sign in to comment.