Skip to content

Commit

Permalink
Update snapshots (should only contain number changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Feb 6, 2024
1 parent 9d18c94 commit f51b845
Show file tree
Hide file tree
Showing 1,367 changed files with 177,804 additions and 177,776 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
-- Combine Aggregated Outputs
-- Compute Metrics via Expressions
SELECT
COALESCE(MAX(subq_28.buys), 0) AS visit_buy_conversions
COALESCE(MAX(subq_37.buys), 0) AS visit_buy_conversions
FROM (
-- Read Elements From Semantic Model 'visits_source'
-- Metric Time Dimension 'ds'
-- Pass Only Elements: ['visits',]
-- Aggregate Measures
SELECT
SUM(1) AS visits
FROM ***************************.fct_visits visits_source_src_28011
) subq_18
FROM ***************************.fct_visits visits_source_src_28000
) subq_27
CROSS JOIN (
-- Find conversions for user within the range of 7 day
-- Pass Only Elements: ['buys',]
Expand All @@ -20,11 +20,11 @@ CROSS JOIN (
FROM (
-- Dedupe the fanout with mf_internal_uuid in the conversion data set
SELECT DISTINCT
first_value(subq_21.visits) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS visits
, first_value(subq_21.ds__day) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS ds__day
, first_value(subq_21.user) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS user
, subq_24.mf_internal_uuid AS mf_internal_uuid
, subq_24.buys AS buys
first_value(subq_30.visits) OVER (PARTITION BY subq_33.user, subq_33.ds__day, subq_33.mf_internal_uuid ORDER BY subq_30.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS visits
, first_value(subq_30.ds__day) OVER (PARTITION BY subq_33.user, subq_33.ds__day, subq_33.mf_internal_uuid ORDER BY subq_30.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS ds__day
, first_value(subq_30.user) OVER (PARTITION BY subq_33.user, subq_33.ds__day, subq_33.mf_internal_uuid ORDER BY subq_30.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS user
, subq_33.mf_internal_uuid AS mf_internal_uuid
, subq_33.buys AS buys
FROM (
-- Read Elements From Semantic Model 'visits_source'
-- Metric Time Dimension 'ds'
Expand All @@ -33,8 +33,8 @@ CROSS JOIN (
DATE_TRUNC(ds, day) AS ds__day
, user_id AS user
, 1 AS visits
FROM ***************************.fct_visits visits_source_src_28011
) subq_21
FROM ***************************.fct_visits visits_source_src_28000
) subq_30
INNER JOIN (
-- Read Elements From Semantic Model 'buys_source'
-- Metric Time Dimension 'ds'
Expand All @@ -44,17 +44,17 @@ CROSS JOIN (
, user_id AS user
, 1 AS buys
, GENERATE_UUID() AS mf_internal_uuid
FROM ***************************.fct_buys buys_source_src_28002
) subq_24
FROM ***************************.fct_buys buys_source_src_28000
) subq_33
ON
(
subq_21.user = subq_24.user
subq_30.user = subq_33.user
) AND (
(
subq_21.ds__day <= subq_24.ds__day
subq_30.ds__day <= subq_33.ds__day
) AND (
subq_21.ds__day > DATE_SUB(CAST(subq_24.ds__day AS DATETIME), INTERVAL 7 day)
subq_30.ds__day > DATE_SUB(CAST(subq_33.ds__day AS DATETIME), INTERVAL 7 day)
)
)
) subq_25
) subq_28
) subq_34
) subq_37

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_18.visit__referrer_id, subq_28.visit__referrer_id) AS visit__referrer_id
, MAX(subq_18.visits) AS visits
, MAX(subq_28.buys) AS buys
COALESCE(subq_27.visit__referrer_id, subq_37.visit__referrer_id) AS visit__referrer_id
, MAX(subq_27.visits) AS visits
, MAX(subq_37.buys) AS buys
FROM (
-- Aggregate Measures
SELECT
Expand All @@ -20,11 +20,11 @@ FROM (
SELECT
referrer_id AS visit__referrer_id
, 1 AS visits
FROM ***************************.fct_visits visits_source_src_28011
) subq_17
FROM ***************************.fct_visits visits_source_src_28000
) subq_26
GROUP BY
visit__referrer_id
) subq_18
) subq_27
FULL OUTER JOIN (
-- Find conversions for user within the range of INF
-- Pass Only Elements: ['buys', 'visit__referrer_id']
Expand All @@ -35,12 +35,12 @@ FROM (
FROM (
-- Dedupe the fanout with mf_internal_uuid in the conversion data set
SELECT DISTINCT
first_value(subq_21.visits) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS visits
, first_value(subq_21.visit__referrer_id) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS visit__referrer_id
, first_value(subq_21.ds__day) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS ds__day
, first_value(subq_21.user) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS user
, subq_24.mf_internal_uuid AS mf_internal_uuid
, subq_24.buys AS buys
first_value(subq_30.visits) OVER (PARTITION BY subq_33.user, subq_33.ds__day, subq_33.mf_internal_uuid ORDER BY subq_30.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS visits
, first_value(subq_30.visit__referrer_id) OVER (PARTITION BY subq_33.user, subq_33.ds__day, subq_33.mf_internal_uuid ORDER BY subq_30.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS visit__referrer_id
, first_value(subq_30.ds__day) OVER (PARTITION BY subq_33.user, subq_33.ds__day, subq_33.mf_internal_uuid ORDER BY subq_30.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS ds__day
, first_value(subq_30.user) OVER (PARTITION BY subq_33.user, subq_33.ds__day, subq_33.mf_internal_uuid ORDER BY subq_30.ds__day DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS user
, subq_33.mf_internal_uuid AS mf_internal_uuid
, subq_33.buys AS buys
FROM (
-- Read Elements From Semantic Model 'visits_source'
-- Metric Time Dimension 'ds'
Expand All @@ -50,8 +50,8 @@ FROM (
, user_id AS user
, referrer_id AS visit__referrer_id
, 1 AS visits
FROM ***************************.fct_visits visits_source_src_28011
) subq_21
FROM ***************************.fct_visits visits_source_src_28000
) subq_30
INNER JOIN (
-- Read Elements From Semantic Model 'buys_source'
-- Metric Time Dimension 'ds'
Expand All @@ -61,20 +61,20 @@ FROM (
, user_id AS user
, 1 AS buys
, GENERATE_UUID() AS mf_internal_uuid
FROM ***************************.fct_buys buys_source_src_28002
) subq_24
FROM ***************************.fct_buys buys_source_src_28000
) subq_33
ON
(
subq_21.user = subq_24.user
subq_30.user = subq_33.user
) AND (
(subq_21.ds__day <= subq_24.ds__day)
(subq_30.ds__day <= subq_33.ds__day)
)
) subq_25
) subq_34
GROUP BY
visit__referrer_id
) subq_28
) subq_37
ON
subq_18.visit__referrer_id = subq_28.visit__referrer_id
subq_27.visit__referrer_id = subq_37.visit__referrer_id
GROUP BY
visit__referrer_id
) subq_29
) subq_38
Loading

0 comments on commit f51b845

Please sign in to comment.