Skip to content
Open

Mssql #100

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ logs/
.idea/
dbt-public-release.code-workspace
integration_tests/dbt_packages
logs/dbt.log
11 changes: 6 additions & 5 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ vars:

#Hash Configuration
datavault4dbt.hash: 'MD5'
datavault4dbt.hash_datatype: 'STRING'
#datavault4dbt.hash_datatype: 'STRING'
datavault4dbt.hash_datatype: 'CHAR(32)' #sql server
datavault4dbt.hashkey_input_case_sensitive: FALSE
datavault4dbt.hashdiff_input_case_sensitive: TRUE
datavault4dbt.hashdiff_input_case_sensitive: FALSE

#Stage Configuration
datavault4dbt.copy_rsrc_ldts_input_columns: false
Expand All @@ -46,9 +47,9 @@ vars:
datavault4dbt.include_business_objects_before_appearance: false

#Ghost Record Configuration
datavault4dbt.beginning_of_all_times: {"bigquery":"0001-01-01T00-00-01","snowflake":"0001-01-01T00:00:01", "exasol": "0001-01-01 00:00:01"}
datavault4dbt.end_of_all_times: {"bigquery":"8888-12-31T23-59-59","snowflake":"8888-12-31T23:59:59", "exasol": "8888-12-31 23:59:59"}
datavault4dbt.timestamp_format: {"bigquery":"%Y-%m-%dT%H-%M-%S","snowflake":"YYYY-MM-DDTHH24:MI:SS", "exasol": "YYYY-mm-dd HH:MI:SS"}
datavault4dbt.beginning_of_all_times: {"bigquery":"0001-01-01T00-00-01","snowflake":"0001-01-01T00:00:01", "exasol": "0001-01-01 00:00:01","sqlserver": "0001-01-01T00:00:01"}
datavault4dbt.end_of_all_times: {"bigquery":"8888-12-31T23-59-59","snowflake":"8888-12-31T23:59:59", "exasol": "8888-12-31 23:59:59", "sqlserver": "8888-12-31T23:59:59"}
datavault4dbt.timestamp_format: {"bigquery":"%Y-%m-%dT%H-%M-%S","snowflake":"YYYY-MM-DDTHH24:MI:SS", "exasol": "YYYY-mm-dd HH:MI:SS","sqlserver": 126}
datavault4dbt.default_unknown_rsrc: 'SYSTEM'
datavault4dbt.default_error_rsrc: 'ERROR'
datavault4dbt.rsrc_default_dtype: 'STRING'
Expand Down
60 changes: 60 additions & 0 deletions logs/dbt.log
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,63 @@
07:08:00.150172 [debug] [MainThread]: STDOUT: "b"usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]\n [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n <command> [<args>]\n\nThese are common Git commands used in various situations:\n\nstart a working area (see also: git help tutorial)\n clone Clone a repository into a new directory\n init Create an empty Git repository or reinitialize an existing one\n\nwork on the current change (see also: git help everyday)\n add Add file contents to the index\n mv Move or rename a file, a directory, or a symlink\n restore Restore working tree files\n rm Remove files from the working tree and from the index\n sparse-checkout Initialize and modify the sparse-checkout\n\nexamine the history and state (see also: git help revisions)\n bisect Use binary search to find the commit that introduced a bug\n diff Show changes between commits, commit and working tree, etc\n grep Print lines matching a pattern\n log Show commit logs\n show Show various types of objects\n status Show the working tree status\n\ngrow, mark and tweak your common history\n branch List, create, or delete branches\n commit Record changes to the repository\n merge Join two or more development histories together\n rebase Reapply commits on top of another base tip\n reset Reset current HEAD to the specified state\n switch Switch branches\n tag Create, list, delete or verify a tag object signed with GPG\n\ncollaborate (see also: git help workflows)\n fetch Download objects and refs from another repository\n pull Fetch from and integrate with another repository or a local branch\n push Update remote refs along with associated objects\n\n'git help -a' and 'git help -g' list available subcommands and some\nconcept guides. See 'git help <command>' or 'git help <concept>'\nto read about a specific subcommand or concept.\nSee 'git help git' for an overview of the system.\n""
07:08:00.150172 [debug] [MainThread]: STDERR: "b''"
07:08:00.153628 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B2FD7C1700>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B2FD7C1C70>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B2FD7C1A90>]}
17:49:07.653032 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CCFB1C5C10>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CCF53931D0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CCFB52A8D0>]}


============================== 17:49:07.657043 | 0595531a-f2fe-4642-8bea-6830d1927301 ==============================
17:49:07.657043 [info ] [MainThread]: Running with dbt=1.5.2
17:49:07.658032 [debug] [MainThread]: running dbt with arguments {'printer_width': '80', 'indirect_selection': 'eager', 'write_json': 'True', 'log_cache_events': 'False', 'partial_parse': 'True', 'cache_selected_only': 'False', 'profiles_dir': 'C:\\Users\\c.mettler\\.dbt', 'version_check': 'True', 'warn_error': 'None', 'log_path': 'c:\\Users\\c.mettler\\source\\repos\\datavault4dbt\\logs', 'debug': 'False', 'fail_fast': 'False', 'use_colors': 'True', 'use_experimental_parser': 'False', 'no_print': 'None', 'quiet': 'False', 'warn_error_options': 'WarnErrorOptions(include=[], exclude=[])', 'static_parser': 'True', 'log_format': 'default', 'introspect': 'True', 'target_path': 'None', 'send_anonymous_usage_stats': 'True'}
17:49:07.664537 [error] [MainThread]: Encountered an error:
Runtime Error
Could not find profile named 'datavault4dbt'
17:49:07.665538 [debug] [MainThread]: Command `cli compile` failed at 17:49:07.665538 after 0.05 seconds
17:49:07.665538 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CCF5020B50>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CCFB52B8D0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CCFB5BF150>]}
17:49:07.666539 [debug] [MainThread]: Flushing usage events
16:22:43.599755 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000171FF88A410>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000171FF94F650>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000171FF0F5210>]}


============================== 16:22:43.599755 | 3f5729f7-8487-4a72-99bc-98123140e349 ==============================
16:22:43.599755 [info ] [MainThread]: Running with dbt=1.5.2
16:22:43.599755 [debug] [MainThread]: running dbt with arguments {'printer_width': '80', 'indirect_selection': 'eager', 'log_cache_events': 'False', 'write_json': 'True', 'partial_parse': 'True', 'cache_selected_only': 'False', 'profiles_dir': 'C:\\Users\\c.mettler\\.dbt', 'debug': 'False', 'version_check': 'True', 'log_path': 'c:\\Users\\c.mettler\\source\\repos\\datavault4dbt\\logs', 'fail_fast': 'False', 'warn_error': 'None', 'use_colors': 'True', 'use_experimental_parser': 'False', 'no_print': 'None', 'quiet': 'False', 'log_format': 'default', 'introspect': 'True', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptions(include=[], exclude=[])', 'target_path': 'None', 'send_anonymous_usage_stats': 'True'}
16:22:43.613862 [error] [MainThread]: Encountered an error:
Runtime Error
Could not find profile named 'datavault4dbt'
16:22:43.615872 [debug] [MainThread]: Command `cli compile` failed at 16:22:43.615872 after 0.05 seconds
16:22:43.615872 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000171FF60CED0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000171FFEF3950>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000171FFEF3F90>]}
16:22:43.616899 [debug] [MainThread]: Flushing usage events
16:27:44.069575 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E60B4DA410>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E60B8A1A10>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E60B8BA6D0>]}


============================== 16:27:44.069575 | 52a394be-42d8-4806-aab1-1faa4e23fea4 ==============================
16:27:44.069575 [info ] [MainThread]: Running with dbt=1.5.2
16:27:44.069575 [debug] [MainThread]: running dbt with arguments {'printer_width': '80', 'indirect_selection': 'eager', 'write_json': 'True', 'log_cache_events': 'False', 'partial_parse': 'True', 'cache_selected_only': 'False', 'profiles_dir': 'C:\\Users\\c.mettler\\.dbt', 'version_check': 'True', 'fail_fast': 'False', 'log_path': 'c:\\Users\\c.mettler\\source\\repos\\datavault4dbt\\logs', 'debug': 'False', 'warn_error': 'None', 'use_colors': 'True', 'use_experimental_parser': 'False', 'no_print': 'None', 'quiet': 'False', 'log_format': 'default', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptions(include=[], exclude=[])', 'introspect': 'True', 'target_path': 'None', 'send_anonymous_usage_stats': 'True'}
16:27:44.085222 [error] [MainThread]: Encountered an error:
Runtime Error
Could not find profile named 'datavault4dbt'
16:27:44.085222 [debug] [MainThread]: Command `cli compile` failed at 16:27:44.085222 after 0.05 seconds
16:27:44.085222 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E6096C56D0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E60BDE3F10>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E60B59E250>]}
16:27:44.085222 [debug] [MainThread]: Flushing usage events
16:29:19.839905 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000208F50C2410>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000208F4D320D0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000208F50C1B90>]}


============================== 16:29:19.839905 | f2b36744-3d92-420a-a81e-0d3df06a3923 ==============================
16:29:19.839905 [info ] [MainThread]: Running with dbt=1.5.2
16:29:19.839905 [debug] [MainThread]: running dbt with arguments {'printer_width': '80', 'indirect_selection': 'eager', 'write_json': 'True', 'log_cache_events': 'False', 'partial_parse': 'True', 'cache_selected_only': 'False', 'profiles_dir': 'C:\\Users\\c.mettler\\.dbt', 'debug': 'False', 'fail_fast': 'False', 'log_path': 'c:\\Users\\c.mettler\\source\\repos\\datavault4dbt\\logs', 'version_check': 'True', 'warn_error': 'None', 'use_colors': 'True', 'use_experimental_parser': 'False', 'no_print': 'None', 'quiet': 'False', 'log_format': 'default', 'static_parser': 'True', 'introspect': 'True', 'warn_error_options': 'WarnErrorOptions(include=[], exclude=[])', 'target_path': 'None', 'send_anonymous_usage_stats': 'True'}
16:29:19.860855 [error] [MainThread]: Encountered an error:
Runtime Error
Could not find profile named 'datavault4dbt'
16:29:19.861855 [debug] [MainThread]: Command `cli compile` failed at 16:29:19.861855 after 0.05 seconds
16:29:19.862364 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000208F512F150>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000208F512C6D0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000208EEB40750>]}
16:29:19.862364 [debug] [MainThread]: Flushing usage events
16:39:34.399102 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002D3A8CB1010>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002D3A8845DD0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002D3A8BA9B90>]}


============================== 16:39:34.399102 | 9bf3d8b9-40fb-4a92-94f1-b9eab1424870 ==============================
16:39:34.399102 [info ] [MainThread]: Running with dbt=1.5.2
16:39:34.399102 [debug] [MainThread]: running dbt with arguments {'printer_width': '80', 'indirect_selection': 'eager', 'write_json': 'True', 'log_cache_events': 'False', 'partial_parse': 'True', 'cache_selected_only': 'False', 'profiles_dir': 'C:\\Users\\c.mettler\\.dbt', 'version_check': 'True', 'fail_fast': 'False', 'log_path': 'c:\\Users\\c.mettler\\source\\repos\\datavault4dbt\\logs', 'debug': 'False', 'warn_error': 'None', 'use_colors': 'True', 'use_experimental_parser': 'False', 'no_print': 'None', 'quiet': 'False', 'log_format': 'default', 'static_parser': 'True', 'introspect': 'True', 'warn_error_options': 'WarnErrorOptions(include=[], exclude=[])', 'target_path': 'None', 'send_anonymous_usage_stats': 'True'}
16:39:34.399102 [error] [MainThread]: Encountered an error:
Runtime Error
Could not find profile named 'datavault4dbt'
16:39:34.413612 [debug] [MainThread]: Command `cli compile` failed at 16:39:34.399102 after 0.05 seconds
16:39:34.414470 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002D3A8C91910>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002D3A88DAA50>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002D3A91E7690>]}
16:39:34.414470 [debug] [MainThread]: Flushing usage events
14 changes: 14 additions & 0 deletions macros/hooks/clean_up_pits.sql
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,17 @@ WHERE pit.{{ sdts }} NOT IN (SELECT {{ sdts }} FROM {{ ref(snapshot_relation) }}

{%- endmacro -%}


{%- macro sqlserver__clean_up_pit(snapshot_relation, snapshot_trigger_column, sdts) -%}

DELETE pit FROM {{ this }} pit
left join {{ ref(snapshot_relation) }} snap
on snap.{{ snapshot_trigger_column }}=1
and snap.{{ sdts }} = pit.{{ sdts }}
WHERE snap.{{ sdts }} is null

{%- if execute -%}
{{ log("PIT " ~ this ~ " successfully cleaned!", True) }}
{%- endif -%}

{%- endmacro -%}
Loading