Skip to content

Commit

Permalink
Update SQL engine snapshots for new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Jul 30, 2024
1 parent 0f0c956 commit 857a942
Show file tree
Hide file tree
Showing 60 changed files with 17,682 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-- Join Self Over Time Range
-- Pass Only Elements: ['archived_users', 'metric_time__hour']
-- Aggregate Measures
-- Compute Metrics via Expressions
SELECT
subq_10.ts AS metric_time__hour
, SUM(subq_8.archived_users) AS subdaily_cumulative_grain_to_date_metric
FROM ***************************.mf_time_spine_hour subq_10
INNER JOIN (
-- Read Elements From Semantic Model 'users_ds_source'
-- Metric Time Dimension 'archived_at'
SELECT
DATETIME_TRUNC(archived_at, hour) AS metric_time__hour
, 1 AS archived_users
FROM ***************************.dim_users users_ds_source_src_28000
) subq_8
ON
(
subq_8.metric_time__hour <= subq_10.ts
) AND (
subq_8.metric_time__hour >= DATETIME_TRUNC(subq_10.ts, hour)
)
GROUP BY
metric_time__hour

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-- Join Self Over Time Range
-- Pass Only Elements: ['archived_users', 'metric_time__hour']
-- Aggregate Measures
-- Compute Metrics via Expressions
SELECT
subq_10.ts AS metric_time__hour
, SUM(subq_8.archived_users) AS subdaily_cumulative_window_metric
FROM ***************************.mf_time_spine_hour subq_10
INNER JOIN (
-- Read Elements From Semantic Model 'users_ds_source'
-- Metric Time Dimension 'archived_at'
SELECT
DATETIME_TRUNC(archived_at, hour) AS metric_time__hour
, 1 AS archived_users
FROM ***************************.dim_users users_ds_source_src_28000
) subq_8
ON
(
subq_8.metric_time__hour <= subq_10.ts
) AND (
subq_8.metric_time__hour > DATE_SUB(CAST(subq_10.ts AS DATETIME), INTERVAL 3 hour)
)
GROUP BY
metric_time__hour

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- Join to Time Spine Dataset
-- Compute Metrics via Expressions
SELECT
subq_12.ts AS metric_time__hour
, subq_10.archived_users AS subdaily_join_to_time_spine_metric
FROM ***************************.mf_time_spine_hour subq_12
LEFT OUTER JOIN (
-- Aggregate Measures
SELECT
metric_time__hour
, SUM(archived_users) AS archived_users
FROM (
-- Read Elements From Semantic Model 'users_ds_source'
-- Metric Time Dimension 'archived_at'
-- Pass Only Elements: ['archived_users', 'metric_time__hour']
SELECT
DATETIME_TRUNC(archived_at, hour) AS metric_time__hour
, 1 AS archived_users
FROM ***************************.dim_users users_ds_source_src_28000
) subq_9
GROUP BY
metric_time__hour
) subq_10
ON
subq_12.ts = subq_10.metric_time__hour

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- Compute Metrics via Expressions
SELECT
metric_time__hour
, archived_users AS subdaily_offset_grain_to_date_metric
FROM (
-- Join to Time Spine Dataset
-- Pass Only Elements: ['archived_users', 'metric_time__hour']
-- Aggregate Measures
-- Compute Metrics via Expressions
SELECT
subq_11.ts AS metric_time__hour
, SUM(subq_9.archived_users) AS archived_users
FROM ***************************.mf_time_spine_hour subq_11
INNER JOIN (
-- Read Elements From Semantic Model 'users_ds_source'
-- Metric Time Dimension 'archived_at'
SELECT
DATETIME_TRUNC(archived_at, hour) AS metric_time__hour
, 1 AS archived_users
FROM ***************************.dim_users users_ds_source_src_28000
) subq_9
ON
DATETIME_TRUNC(subq_11.ts, hour) = subq_9.metric_time__hour
GROUP BY
metric_time__hour
) subq_15

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- Compute Metrics via Expressions
SELECT
metric_time__hour
, archived_users AS subdaily_offset_window_metric
FROM (
-- Join to Time Spine Dataset
-- Pass Only Elements: ['archived_users', 'metric_time__hour']
-- Aggregate Measures
-- Compute Metrics via Expressions
SELECT
subq_11.ts AS metric_time__hour
, SUM(subq_9.archived_users) AS archived_users
FROM ***************************.mf_time_spine_hour subq_11
INNER JOIN (
-- Read Elements From Semantic Model 'users_ds_source'
-- Metric Time Dimension 'archived_at'
SELECT
DATETIME_TRUNC(archived_at, hour) AS metric_time__hour
, 1 AS archived_users
FROM ***************************.dim_users users_ds_source_src_28000
) subq_9
ON
DATE_SUB(CAST(subq_11.ts AS DATETIME), INTERVAL 1 hour) = subq_9.metric_time__hour
GROUP BY
metric_time__hour
) subq_15

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-- Join Self Over Time Range
-- Pass Only Elements: ['archived_users', 'metric_time__hour']
-- Aggregate Measures
-- Compute Metrics via Expressions
SELECT
subq_10.ts AS metric_time__hour
, SUM(subq_8.archived_users) AS subdaily_cumulative_grain_to_date_metric
FROM ***************************.mf_time_spine_hour subq_10
INNER JOIN (
-- Read Elements From Semantic Model 'users_ds_source'
-- Metric Time Dimension 'archived_at'
SELECT
DATE_TRUNC('hour', archived_at) AS metric_time__hour
, 1 AS archived_users
FROM ***************************.dim_users users_ds_source_src_28000
) subq_8
ON
(
subq_8.metric_time__hour <= subq_10.ts
) AND (
subq_8.metric_time__hour >= DATE_TRUNC('hour', subq_10.ts)
)
GROUP BY
subq_10.ts
Loading

0 comments on commit 857a942

Please sign in to comment.