Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: limit the amount of context data we parse #684

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ WHERE
event_unstruct.contexts IS NOT NULL
AND context.value:schema::STRING
!= 'iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0'
-- limit to last 6 months for performance purposes
AND event_unstruct.event_created_at::DATE > DATEADD(MONTH, -6, CURRENT_DATE())

{% if is_incremental() %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ WITH base_1_0_0 AS (
MAX(SPLIT_PART(schema_name, '/', -1)) AS schema_version
FROM {{ ref('context_base') }}
WHERE schema_name = 'iglu:com.meltano/cli_context/jsonschema/1-0-0'
AND context_base.event_created_at::DATE > DATEADD(MONTH, -6, CURRENT_DATE())
GROUP BY 1
),

Expand Down Expand Up @@ -51,6 +52,7 @@ base_1_1_0_onward AS (
WHERE
schema_name LIKE 'iglu:com.meltano/cli_context/%'
AND schema_name != 'iglu:com.meltano/cli_context/jsonschema/1-0-0'
AND context_base.event_created_at::DATE > DATEADD(MONTH, -6, CURRENT_DATE())
GROUP BY 1

)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ WITH base AS (
FROM {{ ref('context_base') }}
WHERE
schema_name LIKE 'iglu:com.meltano/environment_context/%'
AND context_base.event_created_at::DATE > DATEADD(MONTH, -6, CURRENT_DATE())
GROUP BY 1

)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ WITH base AS (
FROM {{ ref('context_base') }}
WHERE
schema_name LIKE 'iglu:com.meltano/exception_context/%'
AND context_base.event_created_at::DATE > DATEADD(MONTH, -6, CURRENT_DATE())
GROUP BY 1

)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ WITH base AS (
FROM {{ ref('context_base') }}
WHERE
schema_name LIKE 'iglu:com.meltano/identify_context/%'
AND context_base.event_created_at::DATE > DATEADD(MONTH, -6, CURRENT_DATE())
GROUP BY 1

)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ WITH base AS (
FROM {{ ref('context_base') }}
WHERE
schema_name LIKE 'iglu:com.meltano/plugins_context/%'
AND context_base.event_created_at::DATE > DATEADD(MONTH, -6, CURRENT_DATE())

),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ WITH base AS (
FROM {{ ref('context_base') }}
WHERE
schema_name LIKE 'iglu:com.meltano/project_context/%'
AND context_base.event_created_at::DATE > DATEADD(MONTH, -6, CURRENT_DATE())
GROUP BY 1

)
Expand Down
Loading