Skip to content

Commit

Permalink
Update engine snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
tlento committed Jun 14, 2024
1 parent 00b75a7 commit 88e4cbb
Show file tree
Hide file tree
Showing 402 changed files with 53,890 additions and 53,890 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ SELECT
FROM (
-- Combine Aggregated Outputs
SELECT
COALESCE(subq_31.visit__referrer_id, subq_42.visit__referrer_id) AS visit__referrer_id
, MAX(subq_31.visits) AS visits
, MAX(subq_42.buys) AS buys
COALESCE(subq_23.visit__referrer_id, subq_34.visit__referrer_id) AS visit__referrer_id
, MAX(subq_23.visits) AS visits
, MAX(subq_34.buys) AS buys
FROM (
-- Constrain Output with WHERE
-- Aggregate Measures
Expand All @@ -24,11 +24,11 @@ FROM (
, 1 AS visits
FROM ***************************.fct_visits visits_source_src_28000
WHERE DATETIME_TRUNC(ds, day) BETWEEN '2020-01-01' AND '2020-01-02'
) subq_29
) subq_21
WHERE visit__referrer_id = 'ref_id_01'
GROUP BY
visit__referrer_id
) subq_31
) subq_23
FULL OUTER JOIN (
-- Find conversions for user within the range of INF
-- Pass Only Elements: ['buys', 'visit__referrer_id']
Expand All @@ -39,40 +39,40 @@ FROM (
FROM (
-- Dedupe the fanout with mf_internal_uuid in the conversion data set
SELECT DISTINCT
first_value(subq_35.visits) OVER (
first_value(subq_27.visits) OVER (
PARTITION BY
subq_38.user
, subq_38.ds__day
, subq_38.mf_internal_uuid
ORDER BY subq_35.ds__day DESC
subq_30.user
, subq_30.ds__day
, subq_30.mf_internal_uuid
ORDER BY subq_27.ds__day DESC
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
) AS visits
, first_value(subq_35.visit__referrer_id) OVER (
, first_value(subq_27.visit__referrer_id) OVER (
PARTITION BY
subq_38.user
, subq_38.ds__day
, subq_38.mf_internal_uuid
ORDER BY subq_35.ds__day DESC
subq_30.user
, subq_30.ds__day
, subq_30.mf_internal_uuid
ORDER BY subq_27.ds__day DESC
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
) AS visit__referrer_id
, first_value(subq_35.ds__day) OVER (
, first_value(subq_27.ds__day) OVER (
PARTITION BY
subq_38.user
, subq_38.ds__day
, subq_38.mf_internal_uuid
ORDER BY subq_35.ds__day DESC
subq_30.user
, subq_30.ds__day
, subq_30.mf_internal_uuid
ORDER BY subq_27.ds__day DESC
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
) AS ds__day
, first_value(subq_35.user) OVER (
, first_value(subq_27.user) OVER (
PARTITION BY
subq_38.user
, subq_38.ds__day
, subq_38.mf_internal_uuid
ORDER BY subq_35.ds__day DESC
subq_30.user
, subq_30.ds__day
, subq_30.mf_internal_uuid
ORDER BY subq_27.ds__day DESC
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
) AS user
, subq_38.mf_internal_uuid AS mf_internal_uuid
, subq_38.buys AS buys
, subq_30.mf_internal_uuid AS mf_internal_uuid
, subq_30.buys AS buys
FROM (
-- Read Elements From Semantic Model 'visits_source'
-- Metric Time Dimension 'ds'
Expand All @@ -85,7 +85,7 @@ FROM (
, 1 AS visits
FROM ***************************.fct_visits visits_source_src_28000
WHERE DATETIME_TRUNC(ds, day) BETWEEN '2020-01-01' AND '2020-01-02'
) subq_35
) subq_27
INNER JOIN (
-- Read Elements From Semantic Model 'buys_source'
-- Metric Time Dimension 'ds'
Expand All @@ -96,19 +96,19 @@ FROM (
, 1 AS buys
, GENERATE_UUID() AS mf_internal_uuid
FROM ***************************.fct_buys buys_source_src_28000
) subq_38
) subq_30
ON
(
subq_35.user = subq_38.user
subq_27.user = subq_30.user
) AND (
(subq_35.ds__day <= subq_38.ds__day)
(subq_27.ds__day <= subq_30.ds__day)
)
) subq_39
) subq_31
GROUP BY
visit__referrer_id
) subq_42
) subq_34
ON
subq_31.visit__referrer_id = subq_42.visit__referrer_id
subq_23.visit__referrer_id = subq_34.visit__referrer_id
GROUP BY
visit__referrer_id
) subq_43
) subq_35
Loading

0 comments on commit 88e4cbb

Please sign in to comment.