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 Sep 24, 2024
1 parent 8cc1c7f commit d78a350
Show file tree
Hide file tree
Showing 12 changed files with 2,466 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- Pass Only Elements: ['bookings', 'listing__ds__day']
-- Join to Custom Granularity Dataset
-- Pass Only Elements: ['bookings', 'listing__ds__martian_day']
-- Aggregate Measures
-- Compute Metrics via Expressions
SELECT
subq_18.martian_day AS listing__ds__martian_day
, SUM(subq_17.bookings) AS bookings
FROM (
-- Join Standard Outputs
SELECT
DATETIME_TRUNC(listings_latest_src_28000.created_at, day) AS listing__ds__day
, subq_13.bookings AS bookings
FROM (
-- Read Elements From Semantic Model 'bookings_source'
-- Metric Time Dimension 'ds'
-- Pass Only Elements: ['bookings', 'listing']
SELECT
listing_id AS listing
, 1 AS bookings
FROM ***************************.fct_bookings bookings_source_src_28000
) subq_13
LEFT OUTER JOIN
***************************.dim_listings_latest listings_latest_src_28000
ON
subq_13.listing = listings_latest_src_28000.listing_id
) subq_17
LEFT OUTER JOIN
***************************.mf_time_spine subq_18
ON
subq_17.listing__ds__day = subq_18.ds
GROUP BY
listing__ds__martian_day

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- Pass Only Elements: ['bookings', 'listing__ds__day']
-- Join to Custom Granularity Dataset
-- Pass Only Elements: ['bookings', 'listing__ds__martian_day']
-- Aggregate Measures
-- Compute Metrics via Expressions
SELECT
subq_18.martian_day AS listing__ds__martian_day
, SUM(subq_17.bookings) AS bookings
FROM (
-- Join Standard Outputs
SELECT
DATE_TRUNC('day', listings_latest_src_28000.created_at) AS listing__ds__day
, subq_13.bookings AS bookings
FROM (
-- Read Elements From Semantic Model 'bookings_source'
-- Metric Time Dimension 'ds'
-- Pass Only Elements: ['bookings', 'listing']
SELECT
listing_id AS listing
, 1 AS bookings
FROM ***************************.fct_bookings bookings_source_src_28000
) subq_13
LEFT OUTER JOIN
***************************.dim_listings_latest listings_latest_src_28000
ON
subq_13.listing = listings_latest_src_28000.listing_id
) subq_17
LEFT OUTER JOIN
***************************.mf_time_spine subq_18
ON
subq_17.listing__ds__day = subq_18.ds
GROUP BY
subq_18.martian_day

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- Pass Only Elements: ['bookings', 'listing__ds__day']
-- Join to Custom Granularity Dataset
-- Pass Only Elements: ['bookings', 'listing__ds__martian_day']
-- Aggregate Measures
-- Compute Metrics via Expressions
SELECT
subq_18.martian_day AS listing__ds__martian_day
, SUM(subq_17.bookings) AS bookings
FROM (
-- Join Standard Outputs
SELECT
DATE_TRUNC('day', listings_latest_src_28000.created_at) AS listing__ds__day
, subq_13.bookings AS bookings
FROM (
-- Read Elements From Semantic Model 'bookings_source'
-- Metric Time Dimension 'ds'
-- Pass Only Elements: ['bookings', 'listing']
SELECT
listing_id AS listing
, 1 AS bookings
FROM ***************************.fct_bookings bookings_source_src_28000
) subq_13
LEFT OUTER JOIN
***************************.dim_listings_latest listings_latest_src_28000
ON
subq_13.listing = listings_latest_src_28000.listing_id
) subq_17
LEFT OUTER JOIN
***************************.mf_time_spine subq_18
ON
subq_17.listing__ds__day = subq_18.ds
GROUP BY
subq_18.martian_day

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- Pass Only Elements: ['bookings', 'listing__ds__day']
-- Join to Custom Granularity Dataset
-- Pass Only Elements: ['bookings', 'listing__ds__martian_day']
-- Aggregate Measures
-- Compute Metrics via Expressions
SELECT
subq_18.martian_day AS listing__ds__martian_day
, SUM(subq_17.bookings) AS bookings
FROM (
-- Join Standard Outputs
SELECT
DATE_TRUNC('day', listings_latest_src_28000.created_at) AS listing__ds__day
, subq_13.bookings AS bookings
FROM (
-- Read Elements From Semantic Model 'bookings_source'
-- Metric Time Dimension 'ds'
-- Pass Only Elements: ['bookings', 'listing']
SELECT
listing_id AS listing
, 1 AS bookings
FROM ***************************.fct_bookings bookings_source_src_28000
) subq_13
LEFT OUTER JOIN
***************************.dim_listings_latest listings_latest_src_28000
ON
subq_13.listing = listings_latest_src_28000.listing_id
) subq_17
LEFT OUTER JOIN
***************************.mf_time_spine subq_18
ON
subq_17.listing__ds__day = subq_18.ds
GROUP BY
subq_18.martian_day
Loading

0 comments on commit d78a350

Please sign in to comment.