-
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.
- Loading branch information
1 parent
3db7cc2
commit 82c61bf
Showing
66 changed files
with
998 additions
and
714 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: automate_dv | ||
version: 0.9.5 | ||
version: 0.9.7 | ||
require-dbt-version: [">=1.0.0", "<2.0.0"] | ||
config-version: 2 | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (c) Business Thinking Ltd. 2019-2023 | ||
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault | ||
*/ | ||
|
||
{% macro timestamp_add(datepart, interval, from_date_or_timestamp) %} | ||
{{ return(adapter.dispatch('timestamp_add', 'automate_dv')(datepart=datepart, interval=interval, | ||
from_date_or_timestamp=from_date_or_timestamp)) }} | ||
{%- endmacro -%} | ||
|
||
{%- macro default__timestamp_add(datepart, interval, from_date_or_timestamp) -%} | ||
|
||
{%- if datepart is in ['day', 'week', 'month', 'quarter', 'year'] -%} | ||
{{ automate_dv.dateadd('millisecond', 86399999, from_date_or_timestamp) }} | ||
{%- elif datepart == 'microsecond' -%} | ||
{{ automate_dv.dateadd('microsecond', 1, from_date_or_timestamp) }} | ||
{%- elif datepart == 'millisecond' -%} | ||
{{ automate_dv.dateadd('microsecond', 999, from_date_or_timestamp) }} | ||
{%- elif datepart == 'second' -%} | ||
{{ automate_dv.dateadd('millisecond', 999, from_date_or_timestamp) }} | ||
{%- elif datepart == 'minute' -%} | ||
{{ automate_dv.dateadd('millisecond', 5999, from_date_or_timestamp) }} | ||
{%- elif datepart == 'hour' -%} | ||
{{ automate_dv.dateadd('millisecond', 3599999, from_date_or_timestamp) }} | ||
{%- endif -%} | ||
|
||
{%- endmacro -%} | ||
|
||
{% macro bigquery__timestamp_add(datepart, interval, from_date_or_timestamp) %} | ||
|
||
{%- if datepart is in ['day', 'week', 'month', 'quarter', 'year'] -%} | ||
{{ automate_dv.dateadd('millisecond', 86399999, from_date_or_timestamp) }} | ||
{%- elif datepart == 'microsecond' -%} | ||
TIMESTAMP_ADD(CAST( {{from_date_or_timestamp}} AS TIMESTAMP), INTERVAL 1 microsecond) | ||
{%- elif datepart == 'millisecond' -%} | ||
TIMESTAMP_ADD(CAST( {{from_date_or_timestamp}} AS TIMESTAMP), INTERVAL 999 microsecond) | ||
{%- elif datepart == 'second' -%} | ||
TIMESTAMP_ADD(CAST( {{from_date_or_timestamp}} AS TIMESTAMP), INTERVAL 999 millisecond) | ||
{%- elif datepart == 'minute' -%} | ||
TIMESTAMP_ADD(CAST( {{from_date_or_timestamp}} AS TIMESTAMP), INTERVAL 5999 millisecond) | ||
{%- elif datepart == 'hour' -%} | ||
TIMESTAMP_ADD(CAST( {{from_date_or_timestamp}} AS TIMESTAMP), INTERVAL 3599999 millisecond) | ||
{%- endif -%} | ||
|
||
{% endmacro %} | ||
|
||
|
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
26 changes: 26 additions & 0 deletions
26
macros/materialisations/period_mat_helpers/error_messages.sql
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) Business Thinking Ltd. 2019-2023 | ||
* This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault | ||
*/ | ||
|
||
{%- macro sqlserver_datepart_too_small_error(period) -%} | ||
|
||
{%- set error_message -%} | ||
This datepart ({{ period }}) is too small and cannot be used for this purpose in MS SQL Server, consider using a different datepart value (e.g. day). | ||
vault_insert_by materialisations are not intended for this purpose, please see https://automate-dv.readthedocs.io/en/latest/materialisations/ | ||
{%- endset -%} | ||
|
||
{{- exceptions.raise_compiler_error(error_message) -}} | ||
|
||
{%- endmacro -%} | ||
|
||
{%- macro sqlserver_max_iterations_error() -%} | ||
|
||
{%- set error_message -%} | ||
Max iterations is 100,000. Consider using a different datepart value (e.g. day) or loading data for a shorter time period. | ||
vault_insert_by materialisations are not intended for this purpose, please see https://automate-dv.readthedocs.io/en/latest/materialisations/ | ||
{%- endset -%} | ||
|
||
{{- exceptions.raise_compiler_error(error_message) -}} | ||
|
||
{%- endmacro -%} |
Oops, something went wrong.