Skip to content

Commit

Permalink
Update SQL engine snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Jul 29, 2024
1 parent fdcf983 commit ed9555c
Show file tree
Hide file tree
Showing 72 changed files with 496 additions and 496 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,18 @@ FROM (
FROM (
-- Time Spine
SELECT
DATETIME_TRUNC(time_spine_src_28000.ds, day) AS ds__day
, DATETIME_TRUNC(time_spine_src_28000.ds, isoweek) AS ds__week
, DATETIME_TRUNC(time_spine_src_28000.ds, month) AS ds__month
, DATETIME_TRUNC(time_spine_src_28000.ds, quarter) AS ds__quarter
, DATETIME_TRUNC(time_spine_src_28000.ds, year) AS ds__year
, EXTRACT(year FROM time_spine_src_28000.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28000.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28000.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28000.ds) AS ds__extract_day
, IF(EXTRACT(dayofweek FROM time_spine_src_28000.ds) = 1, 7, EXTRACT(dayofweek FROM time_spine_src_28000.ds) - 1) AS ds__extract_dow
, EXTRACT(dayofyear FROM time_spine_src_28000.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28000
DATETIME_TRUNC(time_spine_src_28006.ds, day) AS ds__day
, DATETIME_TRUNC(time_spine_src_28006.ds, isoweek) AS ds__week
, DATETIME_TRUNC(time_spine_src_28006.ds, month) AS ds__month
, DATETIME_TRUNC(time_spine_src_28006.ds, quarter) AS ds__quarter
, DATETIME_TRUNC(time_spine_src_28006.ds, year) AS ds__year
, EXTRACT(year FROM time_spine_src_28006.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28006.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28006.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28006.ds) AS ds__extract_day
, IF(EXTRACT(dayofweek FROM time_spine_src_28006.ds) = 1, 7, EXTRACT(dayofweek FROM time_spine_src_28006.ds) - 1) AS ds__extract_dow
, EXTRACT(dayofyear FROM time_spine_src_28006.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28006
) subq_1
) subq_2
) subq_3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
-- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-03T00:00:00]
-- Pass Only Elements: ['user__home_state_latest', 'listing__is_lux_latest', 'metric_time__day']
SELECT
DATETIME_TRUNC(time_spine_src_28000.ds, day) AS metric_time__day
DATETIME_TRUNC(time_spine_src_28006.ds, day) AS metric_time__day
, listings_latest_src_28000.is_lux AS listing__is_lux_latest
, users_latest_src_28000.home_state_latest AS user__home_state_latest
FROM ***************************.dim_listings_latest listings_latest_src_28000
CROSS JOIN
***************************.mf_time_spine time_spine_src_28000
***************************.mf_time_spine time_spine_src_28006
FULL OUTER JOIN
***************************.dim_users_latest users_latest_src_28000
ON
listings_latest_src_28000.user_id = users_latest_src_28000.user_id
WHERE DATETIME_TRUNC(time_spine_src_28000.ds, day) BETWEEN '2020-01-01' AND '2020-01-03'
WHERE DATETIME_TRUNC(time_spine_src_28006.ds, day) BETWEEN '2020-01-01' AND '2020-01-03'
GROUP BY
metric_time__day
, listing__is_lux_latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ FROM (
FROM (
-- Time Spine
SELECT
DATETIME_TRUNC(time_spine_src_28000.ds, day) AS ds__day
, DATETIME_TRUNC(time_spine_src_28000.ds, isoweek) AS ds__week
, DATETIME_TRUNC(time_spine_src_28000.ds, month) AS ds__month
, DATETIME_TRUNC(time_spine_src_28000.ds, quarter) AS ds__quarter
, DATETIME_TRUNC(time_spine_src_28000.ds, year) AS ds__year
, EXTRACT(year FROM time_spine_src_28000.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28000.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28000.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28000.ds) AS ds__extract_day
, IF(EXTRACT(dayofweek FROM time_spine_src_28000.ds) = 1, 7, EXTRACT(dayofweek FROM time_spine_src_28000.ds) - 1) AS ds__extract_dow
, EXTRACT(dayofyear FROM time_spine_src_28000.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28000
DATETIME_TRUNC(time_spine_src_28006.ds, day) AS ds__day
, DATETIME_TRUNC(time_spine_src_28006.ds, isoweek) AS ds__week
, DATETIME_TRUNC(time_spine_src_28006.ds, month) AS ds__month
, DATETIME_TRUNC(time_spine_src_28006.ds, quarter) AS ds__quarter
, DATETIME_TRUNC(time_spine_src_28006.ds, year) AS ds__year
, EXTRACT(year FROM time_spine_src_28006.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28006.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28006.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28006.ds) AS ds__extract_day
, IF(EXTRACT(dayofweek FROM time_spine_src_28006.ds) = 1, 7, EXTRACT(dayofweek FROM time_spine_src_28006.ds) - 1) AS ds__extract_dow
, EXTRACT(dayofyear FROM time_spine_src_28006.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28006
) subq_0
) subq_1
GROUP BY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
-- Pass Only Elements: ['metric_time__day',]
SELECT
DATETIME_TRUNC(ds, day) AS metric_time__day
FROM ***************************.mf_time_spine time_spine_src_28000
FROM ***************************.mf_time_spine time_spine_src_28006
GROUP BY
metric_time__day
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ FROM (
FROM (
-- Time Spine
SELECT
DATETIME_TRUNC(time_spine_src_28000.ds, day) AS ds__day
, DATETIME_TRUNC(time_spine_src_28000.ds, isoweek) AS ds__week
, DATETIME_TRUNC(time_spine_src_28000.ds, month) AS ds__month
, DATETIME_TRUNC(time_spine_src_28000.ds, quarter) AS ds__quarter
, DATETIME_TRUNC(time_spine_src_28000.ds, year) AS ds__year
, EXTRACT(year FROM time_spine_src_28000.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28000.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28000.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28000.ds) AS ds__extract_day
, IF(EXTRACT(dayofweek FROM time_spine_src_28000.ds) = 1, 7, EXTRACT(dayofweek FROM time_spine_src_28000.ds) - 1) AS ds__extract_dow
, EXTRACT(dayofyear FROM time_spine_src_28000.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28000
DATETIME_TRUNC(time_spine_src_28006.ds, day) AS ds__day
, DATETIME_TRUNC(time_spine_src_28006.ds, isoweek) AS ds__week
, DATETIME_TRUNC(time_spine_src_28006.ds, month) AS ds__month
, DATETIME_TRUNC(time_spine_src_28006.ds, quarter) AS ds__quarter
, DATETIME_TRUNC(time_spine_src_28006.ds, year) AS ds__year
, EXTRACT(year FROM time_spine_src_28006.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28006.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28006.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28006.ds) AS ds__extract_day
, IF(EXTRACT(dayofweek FROM time_spine_src_28006.ds) = 1, 7, EXTRACT(dayofweek FROM time_spine_src_28006.ds) - 1) AS ds__extract_dow
, EXTRACT(dayofyear FROM time_spine_src_28006.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28006
) subq_0
) subq_1
GROUP BY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
-- Pass Only Elements: ['metric_time__quarter',]
SELECT
DATETIME_TRUNC(ds, quarter) AS metric_time__quarter
FROM ***************************.mf_time_spine time_spine_src_28000
FROM ***************************.mf_time_spine time_spine_src_28006
GROUP BY
metric_time__quarter
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,18 @@ FROM (
FROM (
-- Time Spine
SELECT
DATETIME_TRUNC(time_spine_src_28000.ds, day) AS ds__day
, DATETIME_TRUNC(time_spine_src_28000.ds, isoweek) AS ds__week
, DATETIME_TRUNC(time_spine_src_28000.ds, month) AS ds__month
, DATETIME_TRUNC(time_spine_src_28000.ds, quarter) AS ds__quarter
, DATETIME_TRUNC(time_spine_src_28000.ds, year) AS ds__year
, EXTRACT(year FROM time_spine_src_28000.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28000.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28000.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28000.ds) AS ds__extract_day
, IF(EXTRACT(dayofweek FROM time_spine_src_28000.ds) = 1, 7, EXTRACT(dayofweek FROM time_spine_src_28000.ds) - 1) AS ds__extract_dow
, EXTRACT(dayofyear FROM time_spine_src_28000.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28000
DATETIME_TRUNC(time_spine_src_28006.ds, day) AS ds__day
, DATETIME_TRUNC(time_spine_src_28006.ds, isoweek) AS ds__week
, DATETIME_TRUNC(time_spine_src_28006.ds, month) AS ds__month
, DATETIME_TRUNC(time_spine_src_28006.ds, quarter) AS ds__quarter
, DATETIME_TRUNC(time_spine_src_28006.ds, year) AS ds__year
, EXTRACT(year FROM time_spine_src_28006.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28006.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28006.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28006.ds) AS ds__extract_day
, IF(EXTRACT(dayofweek FROM time_spine_src_28006.ds) = 1, 7, EXTRACT(dayofweek FROM time_spine_src_28006.ds) - 1) AS ds__extract_dow
, EXTRACT(dayofyear FROM time_spine_src_28006.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28006
) subq_1
) subq_2
) subq_3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-- Join Standard Outputs
-- Pass Only Elements: ['user__home_state_latest', 'listing__is_lux_latest', 'metric_time__day']
SELECT
DATETIME_TRUNC(time_spine_src_28000.ds, day) AS metric_time__day
DATETIME_TRUNC(time_spine_src_28006.ds, day) AS metric_time__day
, listings_latest_src_28000.is_lux AS listing__is_lux_latest
, users_latest_src_28000.home_state_latest AS user__home_state_latest
FROM ***************************.dim_listings_latest listings_latest_src_28000
CROSS JOIN
***************************.mf_time_spine time_spine_src_28000
***************************.mf_time_spine time_spine_src_28006
FULL OUTER JOIN
***************************.dim_users_latest users_latest_src_28000
ON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,18 @@ FROM (
FROM (
-- Time Spine
SELECT
DATE_TRUNC('day', time_spine_src_28000.ds) AS ds__day
, DATE_TRUNC('week', time_spine_src_28000.ds) AS ds__week
, DATE_TRUNC('month', time_spine_src_28000.ds) AS ds__month
, DATE_TRUNC('quarter', time_spine_src_28000.ds) AS ds__quarter
, DATE_TRUNC('year', time_spine_src_28000.ds) AS ds__year
, EXTRACT(year FROM time_spine_src_28000.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28000.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28000.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28000.ds) AS ds__extract_day
, EXTRACT(DAYOFWEEK_ISO FROM time_spine_src_28000.ds) AS ds__extract_dow
, EXTRACT(doy FROM time_spine_src_28000.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28000
DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day
, DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week
, DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month
, DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter
, DATE_TRUNC('year', time_spine_src_28006.ds) AS ds__year
, EXTRACT(year FROM time_spine_src_28006.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28006.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28006.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28006.ds) AS ds__extract_day
, EXTRACT(DAYOFWEEK_ISO FROM time_spine_src_28006.ds) AS ds__extract_dow
, EXTRACT(doy FROM time_spine_src_28006.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28006
) subq_1
) subq_2
) subq_3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
-- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-03T00:00:00]
-- Pass Only Elements: ['user__home_state_latest', 'listing__is_lux_latest', 'metric_time__day']
SELECT
DATE_TRUNC('day', time_spine_src_28000.ds) AS metric_time__day
DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day
, listings_latest_src_28000.is_lux AS listing__is_lux_latest
, users_latest_src_28000.home_state_latest AS user__home_state_latest
FROM ***************************.dim_listings_latest listings_latest_src_28000
CROSS JOIN
***************************.mf_time_spine time_spine_src_28000
***************************.mf_time_spine time_spine_src_28006
FULL OUTER JOIN
***************************.dim_users_latest users_latest_src_28000
ON
listings_latest_src_28000.user_id = users_latest_src_28000.user_id
WHERE DATE_TRUNC('day', time_spine_src_28000.ds) BETWEEN '2020-01-01' AND '2020-01-03'
WHERE DATE_TRUNC('day', time_spine_src_28006.ds) BETWEEN '2020-01-01' AND '2020-01-03'
GROUP BY
DATE_TRUNC('day', time_spine_src_28000.ds)
DATE_TRUNC('day', time_spine_src_28006.ds)
, listings_latest_src_28000.is_lux
, users_latest_src_28000.home_state_latest
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ FROM (
FROM (
-- Time Spine
SELECT
DATE_TRUNC('day', time_spine_src_28000.ds) AS ds__day
, DATE_TRUNC('week', time_spine_src_28000.ds) AS ds__week
, DATE_TRUNC('month', time_spine_src_28000.ds) AS ds__month
, DATE_TRUNC('quarter', time_spine_src_28000.ds) AS ds__quarter
, DATE_TRUNC('year', time_spine_src_28000.ds) AS ds__year
, EXTRACT(year FROM time_spine_src_28000.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28000.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28000.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28000.ds) AS ds__extract_day
, EXTRACT(DAYOFWEEK_ISO FROM time_spine_src_28000.ds) AS ds__extract_dow
, EXTRACT(doy FROM time_spine_src_28000.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28000
DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day
, DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week
, DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month
, DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter
, DATE_TRUNC('year', time_spine_src_28006.ds) AS ds__year
, EXTRACT(year FROM time_spine_src_28006.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28006.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28006.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28006.ds) AS ds__extract_day
, EXTRACT(DAYOFWEEK_ISO FROM time_spine_src_28006.ds) AS ds__extract_dow
, EXTRACT(doy FROM time_spine_src_28006.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28006
) subq_0
) subq_1
GROUP BY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
-- Pass Only Elements: ['metric_time__day',]
SELECT
DATE_TRUNC('day', ds) AS metric_time__day
FROM ***************************.mf_time_spine time_spine_src_28000
FROM ***************************.mf_time_spine time_spine_src_28006
GROUP BY
DATE_TRUNC('day', ds)
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ FROM (
FROM (
-- Time Spine
SELECT
DATE_TRUNC('day', time_spine_src_28000.ds) AS ds__day
, DATE_TRUNC('week', time_spine_src_28000.ds) AS ds__week
, DATE_TRUNC('month', time_spine_src_28000.ds) AS ds__month
, DATE_TRUNC('quarter', time_spine_src_28000.ds) AS ds__quarter
, DATE_TRUNC('year', time_spine_src_28000.ds) AS ds__year
, EXTRACT(year FROM time_spine_src_28000.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28000.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28000.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28000.ds) AS ds__extract_day
, EXTRACT(DAYOFWEEK_ISO FROM time_spine_src_28000.ds) AS ds__extract_dow
, EXTRACT(doy FROM time_spine_src_28000.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28000
DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day
, DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week
, DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month
, DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter
, DATE_TRUNC('year', time_spine_src_28006.ds) AS ds__year
, EXTRACT(year FROM time_spine_src_28006.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28006.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28006.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28006.ds) AS ds__extract_day
, EXTRACT(DAYOFWEEK_ISO FROM time_spine_src_28006.ds) AS ds__extract_dow
, EXTRACT(doy FROM time_spine_src_28006.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28006
) subq_0
) subq_1
GROUP BY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
-- Pass Only Elements: ['metric_time__quarter',]
SELECT
DATE_TRUNC('quarter', ds) AS metric_time__quarter
FROM ***************************.mf_time_spine time_spine_src_28000
FROM ***************************.mf_time_spine time_spine_src_28006
GROUP BY
DATE_TRUNC('quarter', ds)
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,18 @@ FROM (
FROM (
-- Time Spine
SELECT
DATE_TRUNC('day', time_spine_src_28000.ds) AS ds__day
, DATE_TRUNC('week', time_spine_src_28000.ds) AS ds__week
, DATE_TRUNC('month', time_spine_src_28000.ds) AS ds__month
, DATE_TRUNC('quarter', time_spine_src_28000.ds) AS ds__quarter
, DATE_TRUNC('year', time_spine_src_28000.ds) AS ds__year
, EXTRACT(year FROM time_spine_src_28000.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28000.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28000.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28000.ds) AS ds__extract_day
, EXTRACT(DAYOFWEEK_ISO FROM time_spine_src_28000.ds) AS ds__extract_dow
, EXTRACT(doy FROM time_spine_src_28000.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28000
DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day
, DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week
, DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month
, DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter
, DATE_TRUNC('year', time_spine_src_28006.ds) AS ds__year
, EXTRACT(year FROM time_spine_src_28006.ds) AS ds__extract_year
, EXTRACT(quarter FROM time_spine_src_28006.ds) AS ds__extract_quarter
, EXTRACT(month FROM time_spine_src_28006.ds) AS ds__extract_month
, EXTRACT(day FROM time_spine_src_28006.ds) AS ds__extract_day
, EXTRACT(DAYOFWEEK_ISO FROM time_spine_src_28006.ds) AS ds__extract_dow
, EXTRACT(doy FROM time_spine_src_28006.ds) AS ds__extract_doy
FROM ***************************.mf_time_spine time_spine_src_28006
) subq_1
) subq_2
) subq_3
Expand Down
Loading

0 comments on commit ed9555c

Please sign in to comment.