-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added delimited identifier conditional for sql server
- Loading branch information
Showing
17 changed files
with
223 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
with | ||
base as ( | ||
|
||
select * | ||
from {{ ref('stg_dbt__test_executions') }} | ||
|
||
) | ||
|
||
, test_executions as ( | ||
base as (select * from {{ ref("stg_dbt__test_executions") }}), | ||
test_executions as ( | ||
|
||
select | ||
test_execution_id | ||
, command_invocation_id | ||
, node_id | ||
, run_started_at | ||
, was_full_refresh | ||
, thread_id | ||
, status | ||
, compile_started_at | ||
, query_completed_at | ||
, total_node_runtime | ||
, rows_affected | ||
, failures | ||
, message | ||
test_execution_id, | ||
command_invocation_id, | ||
node_id, | ||
run_started_at, | ||
was_full_refresh, | ||
thread_id, | ||
status, | ||
compile_started_at, | ||
query_completed_at, | ||
total_node_runtime, | ||
rows_affected, | ||
failures, | ||
message | ||
from base | ||
|
||
) | ||
|
||
select * from test_executions | ||
select * | ||
from test_executions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,33 @@ | ||
with | ||
base as ( | ||
|
||
select * | ||
from {{ ref('model_executions') }} | ||
|
||
) | ||
|
||
, enhanced as ( | ||
base as (select * from {{ ref("model_executions") }}), | ||
enhanced as ( | ||
|
||
select | ||
{{ dbt_artifacts.generate_surrogate_key(['command_invocation_id', 'node_id']) }} as model_execution_id | ||
, command_invocation_id | ||
, node_id | ||
, run_started_at | ||
, was_full_refresh | ||
, {{ split_part('thread_id', "'-'", 2) }} as thread_id | ||
, status | ||
, compile_started_at | ||
, query_completed_at | ||
, total_node_runtime | ||
, rows_affected | ||
{% if target.type == 'bigquery' %} | ||
, bytes_processed | ||
{% endif %} | ||
, materialization | ||
, "schema" -- noqa | ||
, name | ||
, alias | ||
, message | ||
, adapter_response | ||
{{ dbt_artifacts.generate_surrogate_key(["command_invocation_id", "node_id"]) }} | ||
as model_execution_id, | ||
command_invocation_id, | ||
node_id, | ||
run_started_at, | ||
was_full_refresh, | ||
{{ split_part("thread_id", "'-'", 2) }} as thread_id, | ||
status, | ||
compile_started_at, | ||
query_completed_at, | ||
total_node_runtime, | ||
rows_affected | ||
{% if target.type == "bigquery" %}, bytes_processed {% endif %}, | ||
materialization, | ||
{% if target.type == "sqlserver" %} "schema" | ||
{% else %} schema | ||
{% endif %}, -- noqa | ||
name, | ||
alias, | ||
message, | ||
adapter_response | ||
from base | ||
|
||
) | ||
|
||
select * from enhanced | ||
select * | ||
from enhanced | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
with | ||
base as ( | ||
|
||
select * | ||
from {{ ref('models') }} | ||
|
||
) | ||
|
||
, enhanced as ( | ||
base as (select * from {{ ref("models") }}), | ||
enhanced as ( | ||
|
||
select | ||
{{ dbt_artifacts.generate_surrogate_key(['command_invocation_id', 'node_id']) }} as model_execution_id | ||
, command_invocation_id | ||
, node_id | ||
, run_started_at | ||
, "database" | ||
, "schema" | ||
, name | ||
, depends_on_nodes | ||
, package_name | ||
, path | ||
, checksum | ||
, materialization | ||
, tags | ||
, meta | ||
, alias | ||
{{ dbt_artifacts.generate_surrogate_key(["command_invocation_id", "node_id"]) }} | ||
as model_execution_id, | ||
command_invocation_id, | ||
node_id, | ||
run_started_at, | ||
{% if target.type == "sqlserver" %} "database" | ||
{% else %} database | ||
{% endif %}, | ||
{% if target.type == "sqlserver" %} "schema" | ||
{% else %} schema | ||
{% endif %}, -- noqa | ||
name, | ||
depends_on_nodes, | ||
package_name, | ||
path, | ||
checksum, | ||
materialization, | ||
tags, | ||
meta, | ||
alias | ||
from base | ||
|
||
) | ||
|
||
select * from enhanced | ||
select * | ||
from enhanced | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,32 @@ | ||
with | ||
base as ( | ||
|
||
select * | ||
from {{ ref('seed_executions') }} | ||
|
||
) | ||
|
||
, enhanced as ( | ||
base as (select * from {{ ref("seed_executions") }}), | ||
enhanced as ( | ||
|
||
select | ||
{{ dbt_artifacts.generate_surrogate_key(['command_invocation_id', 'node_id']) }} as seed_execution_id | ||
, command_invocation_id | ||
, node_id | ||
, run_started_at | ||
, was_full_refresh | ||
, {{ split_part('thread_id', "'-'", 2) }} as thread_id | ||
, status | ||
, compile_started_at | ||
, query_completed_at | ||
, total_node_runtime | ||
, rows_affected | ||
, materialization | ||
, "schema" -- noqa | ||
, name | ||
, alias | ||
, message | ||
, adapter_response | ||
{{ dbt_artifacts.generate_surrogate_key(["command_invocation_id", "node_id"]) }} | ||
as seed_execution_id, | ||
command_invocation_id, | ||
node_id, | ||
run_started_at, | ||
was_full_refresh, | ||
{{ split_part("thread_id", "'-'", 2) }} as thread_id, | ||
status, | ||
compile_started_at, | ||
query_completed_at, | ||
total_node_runtime, | ||
rows_affected, | ||
materialization, | ||
{% if target.type == "sqlserver" %} "schema" | ||
{% else %} schema | ||
{% endif %}, -- noqa | ||
name, | ||
alias, | ||
message, | ||
adapter_response | ||
from base | ||
|
||
) | ||
|
||
select * from enhanced | ||
select * | ||
from enhanced | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
with | ||
base as ( | ||
|
||
select * | ||
from {{ ref('seeds') }} | ||
|
||
) | ||
|
||
, enhanced as ( | ||
base as (select * from {{ ref("seeds") }}), | ||
enhanced as ( | ||
|
||
select | ||
{{ dbt_artifacts.generate_surrogate_key(['command_invocation_id', 'node_id']) }} as seed_execution_id | ||
, command_invocation_id | ||
, node_id | ||
, run_started_at | ||
, "database" | ||
, "schema" | ||
, name | ||
, package_name | ||
, path | ||
, checksum | ||
, meta | ||
, alias | ||
{{ dbt_artifacts.generate_surrogate_key(["command_invocation_id", "node_id"]) }} | ||
as seed_execution_id, | ||
command_invocation_id, | ||
node_id, | ||
run_started_at, | ||
{% if target.type == "sqlserver" %} "database" | ||
{% else %} database | ||
{% endif %}, | ||
{% if target.type == "sqlserver" %} "schema" | ||
{% else %} schema | ||
{% endif %}, | ||
name, | ||
package_name, | ||
path, | ||
checksum, | ||
meta, | ||
alias | ||
from base | ||
|
||
) | ||
|
||
select * from enhanced | ||
select * | ||
from enhanced | ||
|
Oops, something went wrong.