-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a one-shot re-do of the snapshot generation for Trino test cases originally done throughout @sarbmeetka's PR (#810). As explained earlier, these were split out to make it easier to isolate the non-automated changes for any necessary updates in CI testing.
- Loading branch information
Showing
202 changed files
with
30,279 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
metricflow/test/snapshots/test_cli.py/str/Trino/test_saved_query__cli_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-18 00:00:00 | 4 | 4 | 2 | | ||
| 2019-12-19 00:00:00 | 4 | 6 | 6 | | ||
| 2019-12-19 00:00:00 | 5 | 2 | 0 | | ||
| 2019-12-20 00:00:00 | 5 | 2 | 0 | | ||
| 2020-01-01 00:00:00 | 4 | 2 | 1 | | ||
| 2020-01-02 00:00:00 | 4 | 3 | 3 | | ||
| 2020-01-02 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-03 00:00:00 | 5 | 1 | 0 | |
3 changes: 3 additions & 0 deletions
3
...t/snapshots/test_cli.py/str/Trino/test_saved_query_with_cumulative_metric__cli_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
| metric_time__day | trailing_2_months_revenue | | ||
|:--------------------|----------------------------:| | ||
| 2020-01-01 00:00:00 | 1000 | |
5 changes: 5 additions & 0 deletions
5
metricflow/test/snapshots/test_cli.py/str/Trino/test_saved_query_with_limit__cli_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-18 00:00:00 | 4 | 4 | 2 | | ||
| 2019-12-19 00:00:00 | 4 | 6 | 6 | |
7 changes: 7 additions & 0 deletions
7
metricflow/test/snapshots/test_cli.py/str/Trino/test_saved_query_with_where__cli_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-19 00:00:00 | 5 | 2 | 0 | | ||
| 2019-12-20 00:00:00 | 5 | 2 | 0 | | ||
| 2020-01-02 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-03 00:00:00 | 5 | 1 | 0 | |
346 changes: 346 additions & 0 deletions
346
...on_metrics_to_sql.py/SqlQueryPlan/Trino/test_conversion_count_with_no_group_by__plan0.sql
Large diffs are not rendered by default.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
..._to_sql.py/SqlQueryPlan/Trino/test_conversion_count_with_no_group_by__plan0_optimized.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
-- Combine Aggregated Outputs | ||
-- Compute Metrics via Expressions | ||
SELECT | ||
COALESCE(MAX(subq_28.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_10011 | ||
) subq_18 | ||
CROSS JOIN ( | ||
-- Find conversions for user within the range of 7 day | ||
-- Pass Only Elements: | ||
-- ['buys'] | ||
-- Aggregate Measures | ||
SELECT | ||
SUM(buys) AS buys | ||
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 | ||
FROM ( | ||
-- Read Elements From Semantic Model 'visits_source' | ||
-- Metric Time Dimension 'ds' | ||
-- Pass Only Elements: | ||
-- ['visits', 'ds__day', 'user'] | ||
SELECT | ||
DATE_TRUNC('day', ds) AS ds__day | ||
, user_id AS user | ||
, 1 AS visits | ||
FROM ***************************.fct_visits visits_source_src_10011 | ||
) subq_21 | ||
INNER JOIN ( | ||
-- Read Elements From Semantic Model 'buys_source' | ||
-- Metric Time Dimension 'ds' | ||
-- Add column with generated UUID | ||
SELECT | ||
DATE_TRUNC('day', ds) AS ds__day | ||
, user_id AS user | ||
, 1 AS buys | ||
, uuid() AS mf_internal_uuid | ||
FROM ***************************.fct_buys buys_source_src_10002 | ||
) subq_24 | ||
ON | ||
( | ||
subq_21.user = subq_24.user | ||
) AND ( | ||
( | ||
subq_21.ds__day <= subq_24.ds__day | ||
) AND ( | ||
subq_21.ds__day > DATE_ADD('day', -7, subq_24.ds__day) | ||
) | ||
) | ||
) subq_25 | ||
) subq_28 |
Oops, something went wrong.