-
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.
SQL rendering tests for custom granularity time dimensions requiring …
…join (#1414) SQL rendering tests for querying time dimensions that require a join with custom granularity.
- Loading branch information
1 parent
41e555f
commit 9f6af7e
Showing
16 changed files
with
2,906 additions
and
1 deletion.
There are no files selected for viewing
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
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
378 changes: 378 additions & 0 deletions
378
...y.py/SqlQueryPlan/BigQuery/test_simple_metric_with_custom_granularity_and_join__plan0.sql
Large diffs are not rendered by default.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
...eryPlan/BigQuery/test_simple_metric_with_custom_granularity_and_join__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,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 |
378 changes: 378 additions & 0 deletions
378
...py/SqlQueryPlan/Databricks/test_simple_metric_with_custom_granularity_and_join__plan0.sql
Large diffs are not rendered by default.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
...yPlan/Databricks/test_simple_metric_with_custom_granularity_and_join__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,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 |
378 changes: 378 additions & 0 deletions
378
...ity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_and_join__plan0.sql
Large diffs are not rendered by default.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
...QueryPlan/DuckDB/test_simple_metric_with_custom_granularity_and_join__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,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 |
Oops, something went wrong.