From bf1312c6b5fa1d1072e249eb2e3d77efe21dbab7 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Fri, 3 May 2024 11:41:00 -0700 Subject: [PATCH] Update SQL engine snapshots --- ...stinct_values_query_with_metric_filter__plan0.sql | 6 +++--- ...ues_query_with_metric_filter__plan0_optimized.sql | 4 ++-- ..._same_semantic_model_as_queried_metric__plan0.sql | 6 +++--- ...ntic_model_as_queried_metric__plan0_optimized.sql | 4 ++-- .../test_metric_filtered_by_itself__plan0.sql | 6 +++--- ...st_metric_filtered_by_itself__plan0_optimized.sql | 4 ++-- ...est_metric_with_metric_in_where_filter__plan0.sql | 6 +++--- ..._with_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...with_cumulative_metric_in_where_filter__plan0.sql | 6 +++--- ...ative_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...ry_with_derived_metric_in_where_filter__plan0.sql | 6 +++--- ...rived_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ..._query_with_multiple_metrics_in_filter__plan0.sql | 12 ++++++------ ...h_multiple_metrics_in_filter__plan0_optimized.sql | 8 ++++---- ...uery_with_ratio_metric_in_where_filter__plan0.sql | 6 +++--- ...ery_with_simple_metric_in_where_filter__plan0.sql | 6 +++--- ...imple_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...stinct_values_query_with_metric_filter__plan0.sql | 6 +++--- ...ues_query_with_metric_filter__plan0_optimized.sql | 4 ++-- ..._same_semantic_model_as_queried_metric__plan0.sql | 6 +++--- ...ntic_model_as_queried_metric__plan0_optimized.sql | 4 ++-- .../test_metric_filtered_by_itself__plan0.sql | 6 +++--- ...st_metric_filtered_by_itself__plan0_optimized.sql | 4 ++-- ...est_metric_with_metric_in_where_filter__plan0.sql | 6 +++--- ..._with_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...with_cumulative_metric_in_where_filter__plan0.sql | 6 +++--- ...ative_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...ry_with_derived_metric_in_where_filter__plan0.sql | 6 +++--- ...rived_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ..._query_with_multiple_metrics_in_filter__plan0.sql | 12 ++++++------ ...h_multiple_metrics_in_filter__plan0_optimized.sql | 8 ++++---- ...uery_with_ratio_metric_in_where_filter__plan0.sql | 6 +++--- ...ery_with_simple_metric_in_where_filter__plan0.sql | 6 +++--- ...imple_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...stinct_values_query_with_metric_filter__plan0.sql | 6 +++--- ...ues_query_with_metric_filter__plan0_optimized.sql | 4 ++-- ..._same_semantic_model_as_queried_metric__plan0.sql | 6 +++--- ...ntic_model_as_queried_metric__plan0_optimized.sql | 4 ++-- .../test_metric_filtered_by_itself__plan0.sql | 6 +++--- ...st_metric_filtered_by_itself__plan0_optimized.sql | 4 ++-- ...est_metric_with_metric_in_where_filter__plan0.sql | 6 +++--- ..._with_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...with_cumulative_metric_in_where_filter__plan0.sql | 6 +++--- ...ative_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...ry_with_derived_metric_in_where_filter__plan0.sql | 6 +++--- ...rived_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ..._query_with_multiple_metrics_in_filter__plan0.sql | 12 ++++++------ ...h_multiple_metrics_in_filter__plan0_optimized.sql | 8 ++++---- ...uery_with_ratio_metric_in_where_filter__plan0.sql | 6 +++--- ...ery_with_simple_metric_in_where_filter__plan0.sql | 6 +++--- ...imple_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...stinct_values_query_with_metric_filter__plan0.sql | 6 +++--- ...ues_query_with_metric_filter__plan0_optimized.sql | 4 ++-- ..._same_semantic_model_as_queried_metric__plan0.sql | 6 +++--- ...ntic_model_as_queried_metric__plan0_optimized.sql | 4 ++-- .../test_metric_filtered_by_itself__plan0.sql | 6 +++--- ...st_metric_filtered_by_itself__plan0_optimized.sql | 4 ++-- ...est_metric_with_metric_in_where_filter__plan0.sql | 6 +++--- ..._with_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...with_cumulative_metric_in_where_filter__plan0.sql | 6 +++--- ...ative_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...ry_with_derived_metric_in_where_filter__plan0.sql | 6 +++--- ...rived_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ..._query_with_multiple_metrics_in_filter__plan0.sql | 12 ++++++------ ...h_multiple_metrics_in_filter__plan0_optimized.sql | 8 ++++---- ...uery_with_ratio_metric_in_where_filter__plan0.sql | 6 +++--- ...ery_with_simple_metric_in_where_filter__plan0.sql | 6 +++--- ...imple_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...stinct_values_query_with_metric_filter__plan0.sql | 6 +++--- ...ues_query_with_metric_filter__plan0_optimized.sql | 4 ++-- ..._same_semantic_model_as_queried_metric__plan0.sql | 6 +++--- ...ntic_model_as_queried_metric__plan0_optimized.sql | 4 ++-- .../test_metric_filtered_by_itself__plan0.sql | 6 +++--- ...st_metric_filtered_by_itself__plan0_optimized.sql | 4 ++-- ...est_metric_with_metric_in_where_filter__plan0.sql | 6 +++--- ..._with_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...with_cumulative_metric_in_where_filter__plan0.sql | 6 +++--- ...ative_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...ry_with_derived_metric_in_where_filter__plan0.sql | 6 +++--- ...rived_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ..._query_with_multiple_metrics_in_filter__plan0.sql | 12 ++++++------ ...h_multiple_metrics_in_filter__plan0_optimized.sql | 8 ++++---- ...uery_with_ratio_metric_in_where_filter__plan0.sql | 6 +++--- ...ery_with_simple_metric_in_where_filter__plan0.sql | 6 +++--- ...imple_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...stinct_values_query_with_metric_filter__plan0.sql | 6 +++--- ...ues_query_with_metric_filter__plan0_optimized.sql | 4 ++-- ..._same_semantic_model_as_queried_metric__plan0.sql | 6 +++--- ...ntic_model_as_queried_metric__plan0_optimized.sql | 4 ++-- .../Trino/test_metric_filtered_by_itself__plan0.sql | 6 +++--- ...st_metric_filtered_by_itself__plan0_optimized.sql | 4 ++-- ...est_metric_with_metric_in_where_filter__plan0.sql | 6 +++--- ..._with_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...with_cumulative_metric_in_where_filter__plan0.sql | 6 +++--- ...ative_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ...ry_with_derived_metric_in_where_filter__plan0.sql | 6 +++--- ...rived_metric_in_where_filter__plan0_optimized.sql | 4 ++-- ..._query_with_multiple_metrics_in_filter__plan0.sql | 12 ++++++------ ...h_multiple_metrics_in_filter__plan0_optimized.sql | 8 ++++---- ...uery_with_ratio_metric_in_where_filter__plan0.sql | 6 +++--- ...ery_with_simple_metric_in_where_filter__plan0.sql | 6 +++--- ...imple_metric_in_where_filter__plan0_optimized.sql | 4 ++-- 102 files changed, 288 insertions(+), 288 deletions(-) diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_distinct_values_query_with_metric_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_distinct_values_query_with_metric_filter__plan0.sql index 4931130af6..e67da26c3a 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_distinct_values_query_with_metric_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_distinct_values_query_with_metric_filter__plan0.sql @@ -14,7 +14,7 @@ FROM ( subq_4.listing AS listing , subq_4.lux_listing AS lux_listing , subq_4.listing__lux_listing AS listing__lux_listing - , subq_10.bookings AS listing__bookings + , subq_10.listing__bookings AS listing__bookings FROM ( -- Read Elements From Semantic Model 'lux_listing_mapping' SELECT @@ -27,12 +27,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_9.listing - , subq_9.bookings + , subq_9.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_8.listing - , subq_8.bookings + , subq_8.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_distinct_values_query_with_metric_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_distinct_values_query_with_metric_filter__plan0_optimized.sql index 28223e439b..fc77fa7686 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_distinct_values_query_with_metric_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_distinct_values_query_with_metric_filter__plan0_optimized.sql @@ -6,7 +6,7 @@ FROM ( -- Join Standard Outputs SELECT lux_listing_mapping_src_28000.listing_id AS listing - , subq_19.bookings AS listing__bookings + , subq_19.listing__bookings AS listing__bookings FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_28000 FULL OUTER JOIN ( -- Aggregate Measures @@ -14,7 +14,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql index 2584bed2d9..b72dfb8369 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.booking_value AS guest__booking_value + , subq_12.guest__booking_value AS guest__booking_value , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT subq_11.guest - , subq_11.booking_value + , subq_11.guest__booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.booking_value + , subq_10.booking_value AS guest__booking_value FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql index 9e4d358214..66052c181c 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__booking_value'] SELECT - subq_26.booking_value AS guest__booking_value + subq_26.guest__booking_value AS guest__booking_value , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT guest_id AS guest - , SUM(booking_value) AS booking_value + , SUM(booking_value) AS guest__booking_value FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_filtered_by_itself__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_filtered_by_itself__plan0.sql index d62c0bcbf0..2ded91a17a 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_filtered_by_itself__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_filtered_by_itself__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.bookers AS guest__bookers + , subq_12.guest__bookers AS guest__bookers , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT subq_11.guest - , subq_11.bookers + , subq_11.guest__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.bookers + , subq_10.bookers AS guest__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_filtered_by_itself__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_filtered_by_itself__plan0_optimized.sql index f1c878acf2..51371a5776 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_filtered_by_itself__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_filtered_by_itself__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__bookers'] SELECT - subq_26.bookers AS guest__bookers + subq_26.guest__bookers AS guest__bookers , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT guest_id AS guest - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS guest__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_with_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_with_metric_in_where_filter__plan0.sql index 73d8af3dbe..4cc263457c 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_with_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_with_metric_in_where_filter__plan0.sql @@ -29,7 +29,7 @@ FROM ( SELECT subq_6.metric_time__day AS metric_time__day , subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing'] @@ -174,12 +174,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_with_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_with_metric_in_where_filter__plan0_optimized.sql index 7fdd4ba033..d89858f577 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_with_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_metric_with_metric_in_where_filter__plan0_optimized.sql @@ -10,7 +10,7 @@ FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing__bookings'] SELECT subq_20.metric_time__day AS metric_time__day - , subq_26.bookings AS listing__bookings + , subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_cumulative_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_cumulative_metric_in_where_filter__plan0.sql index f11fa5d961..19b39288d1 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_cumulative_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_cumulative_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.user AS user - , subq_12.revenue_all_time AS user__revenue_all_time + , subq_12.user__revenue_all_time AS user__revenue_all_time , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'user'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT subq_11.user - , subq_11.revenue_all_time + , subq_11.user__revenue_all_time FROM ( -- Compute Metrics via Expressions SELECT subq_10.user - , subq_10.txn_revenue AS revenue_all_time + , subq_10.txn_revenue AS user__revenue_all_time FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql index 615a6d20aa..fd9065cece 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'user__revenue_all_time'] SELECT - subq_26.revenue_all_time AS user__revenue_all_time + subq_26.user__revenue_all_time AS user__revenue_all_time , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT user_id AS user - , SUM(revenue) AS revenue_all_time + , SUM(revenue) AS user__revenue_all_time FROM ***************************.fct_revenue revenue_src_28000 GROUP BY user diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_derived_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_derived_metric_in_where_filter__plan0.sql index bc6d365e6b..898eaa084e 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_derived_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_derived_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.views_times_booking_value AS listing__views_times_booking_value + , subq_26.listing__views_times_booking_value AS listing__views_times_booking_value , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT subq_25.listing - , subq_25.views_times_booking_value + , subq_25.listing__views_times_booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql index 443b84fe3c..75807bd8d2 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__views_times_booking_value'] SELECT - subq_47.views_times_booking_value AS listing__views_times_booking_value + subq_47.listing__views_times_booking_value AS listing__views_times_booking_value , subq_34.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -24,7 +24,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_multiple_metrics_in_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_multiple_metrics_in_filter__plan0.sql index 68852022d7..dfac5d33d8 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_multiple_metrics_in_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_multiple_metrics_in_filter__plan0.sql @@ -25,8 +25,8 @@ FROM ( -- Join Standard Outputs SELECT subq_10.listing AS listing - , subq_16.bookings AS listing__bookings - , subq_22.bookers AS listing__bookers + , subq_16.listing__bookings AS listing__bookings + , subq_22.listing__bookers AS listing__bookers , subq_10.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing', 'listing'] @@ -170,12 +170,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_15.listing - , subq_15.bookings + , subq_15.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_14.listing - , subq_14.bookings + , subq_14.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT @@ -393,12 +393,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT subq_21.listing - , subq_21.bookers + , subq_21.listing__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_20.listing - , subq_20.bookers + , subq_20.bookers AS listing__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql index 5067868e4c..e1d4b30a5e 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql @@ -8,8 +8,8 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings', 'listing__bookers'] SELECT - subq_36.bookings AS listing__bookings - , subq_42.bookers AS listing__bookers + subq_36.listing__bookings AS listing__bookings + , subq_42.listing__bookers AS listing__bookers , subq_30.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,7 +26,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' @@ -50,7 +50,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT listing_id AS listing - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS listing__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY listing diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_ratio_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_ratio_metric_in_where_filter__plan0.sql index fb23f915b4..22f9fc7ec3 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_ratio_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_ratio_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.bookings_per_booker AS listing__bookings_per_booker + , subq_26.listing__bookings_per_booker AS listing__bookings_per_booker , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings_per_booker'] SELECT subq_25.listing - , subq_25.bookings_per_booker + , subq_25.listing__bookings_per_booker FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , CAST(subq_24.bookings AS FLOAT64) / CAST(NULLIF(subq_24.bookers, 0) AS FLOAT64) AS bookings_per_booker + , CAST(subq_24.bookings AS FLOAT64) / CAST(NULLIF(subq_24.bookers, 0) AS FLOAT64) AS listing__bookings_per_booker FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_simple_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_simple_metric_in_where_filter__plan0.sql index da174c63a4..41ade821a0 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_simple_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_simple_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql index d453137357..daf1268c49 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/BigQuery/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings'] SELECT - subq_26.bookings AS listing__bookings + subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -25,7 +25,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_distinct_values_query_with_metric_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_distinct_values_query_with_metric_filter__plan0.sql index 673561d5db..5ffb3f6a27 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_distinct_values_query_with_metric_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_distinct_values_query_with_metric_filter__plan0.sql @@ -14,7 +14,7 @@ FROM ( subq_4.listing AS listing , subq_4.lux_listing AS lux_listing , subq_4.listing__lux_listing AS listing__lux_listing - , subq_10.bookings AS listing__bookings + , subq_10.listing__bookings AS listing__bookings FROM ( -- Read Elements From Semantic Model 'lux_listing_mapping' SELECT @@ -27,12 +27,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_9.listing - , subq_9.bookings + , subq_9.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_8.listing - , subq_8.bookings + , subq_8.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_distinct_values_query_with_metric_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_distinct_values_query_with_metric_filter__plan0_optimized.sql index 28223e439b..fc77fa7686 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_distinct_values_query_with_metric_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_distinct_values_query_with_metric_filter__plan0_optimized.sql @@ -6,7 +6,7 @@ FROM ( -- Join Standard Outputs SELECT lux_listing_mapping_src_28000.listing_id AS listing - , subq_19.bookings AS listing__bookings + , subq_19.listing__bookings AS listing__bookings FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_28000 FULL OUTER JOIN ( -- Aggregate Measures @@ -14,7 +14,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql index b53451005d..f11a241a72 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.booking_value AS guest__booking_value + , subq_12.guest__booking_value AS guest__booking_value , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT subq_11.guest - , subq_11.booking_value + , subq_11.guest__booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.booking_value + , subq_10.booking_value AS guest__booking_value FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql index 53c4da07c1..bbffa182b2 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__booking_value'] SELECT - subq_26.booking_value AS guest__booking_value + subq_26.guest__booking_value AS guest__booking_value , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT guest_id AS guest - , SUM(booking_value) AS booking_value + , SUM(booking_value) AS guest__booking_value FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_filtered_by_itself__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_filtered_by_itself__plan0.sql index b717fc6ecb..eac39e68f9 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_filtered_by_itself__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_filtered_by_itself__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.bookers AS guest__bookers + , subq_12.guest__bookers AS guest__bookers , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT subq_11.guest - , subq_11.bookers + , subq_11.guest__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.bookers + , subq_10.bookers AS guest__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_filtered_by_itself__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_filtered_by_itself__plan0_optimized.sql index 07a356a39c..8660fddf26 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_filtered_by_itself__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_filtered_by_itself__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__bookers'] SELECT - subq_26.bookers AS guest__bookers + subq_26.guest__bookers AS guest__bookers , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT guest_id AS guest - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS guest__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_with_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_with_metric_in_where_filter__plan0.sql index b75155a4aa..3407014583 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_with_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_with_metric_in_where_filter__plan0.sql @@ -29,7 +29,7 @@ FROM ( SELECT subq_6.metric_time__day AS metric_time__day , subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing'] @@ -174,12 +174,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_with_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_with_metric_in_where_filter__plan0_optimized.sql index 1ad72fa0ef..5d0f9ae9f7 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_with_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_metric_with_metric_in_where_filter__plan0_optimized.sql @@ -10,7 +10,7 @@ FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing__bookings'] SELECT subq_20.metric_time__day AS metric_time__day - , subq_26.bookings AS listing__bookings + , subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_cumulative_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_cumulative_metric_in_where_filter__plan0.sql index 58462086c7..6870c39244 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_cumulative_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_cumulative_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.user AS user - , subq_12.revenue_all_time AS user__revenue_all_time + , subq_12.user__revenue_all_time AS user__revenue_all_time , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'user'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT subq_11.user - , subq_11.revenue_all_time + , subq_11.user__revenue_all_time FROM ( -- Compute Metrics via Expressions SELECT subq_10.user - , subq_10.txn_revenue AS revenue_all_time + , subq_10.txn_revenue AS user__revenue_all_time FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql index ca59324e35..94fa9f69d0 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'user__revenue_all_time'] SELECT - subq_26.revenue_all_time AS user__revenue_all_time + subq_26.user__revenue_all_time AS user__revenue_all_time , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT user_id AS user - , SUM(revenue) AS revenue_all_time + , SUM(revenue) AS user__revenue_all_time FROM ***************************.fct_revenue revenue_src_28000 GROUP BY user_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_derived_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_derived_metric_in_where_filter__plan0.sql index 8197f7958c..fdf044c866 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_derived_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_derived_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.views_times_booking_value AS listing__views_times_booking_value + , subq_26.listing__views_times_booking_value AS listing__views_times_booking_value , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT subq_25.listing - , subq_25.views_times_booking_value + , subq_25.listing__views_times_booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql index d91def71f1..d029af6873 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__views_times_booking_value'] SELECT - subq_47.views_times_booking_value AS listing__views_times_booking_value + subq_47.listing__views_times_booking_value AS listing__views_times_booking_value , subq_34.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -24,7 +24,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_multiple_metrics_in_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_multiple_metrics_in_filter__plan0.sql index 4e1e82ae8e..bf02d2aba6 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_multiple_metrics_in_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_multiple_metrics_in_filter__plan0.sql @@ -25,8 +25,8 @@ FROM ( -- Join Standard Outputs SELECT subq_10.listing AS listing - , subq_16.bookings AS listing__bookings - , subq_22.bookers AS listing__bookers + , subq_16.listing__bookings AS listing__bookings + , subq_22.listing__bookers AS listing__bookers , subq_10.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing', 'listing'] @@ -170,12 +170,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_15.listing - , subq_15.bookings + , subq_15.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_14.listing - , subq_14.bookings + , subq_14.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT @@ -393,12 +393,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT subq_21.listing - , subq_21.bookers + , subq_21.listing__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_20.listing - , subq_20.bookers + , subq_20.bookers AS listing__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql index 746675a7dc..4373c1dcaf 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql @@ -8,8 +8,8 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings', 'listing__bookers'] SELECT - subq_36.bookings AS listing__bookings - , subq_42.bookers AS listing__bookers + subq_36.listing__bookings AS listing__bookings + , subq_42.listing__bookers AS listing__bookers , subq_30.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,7 +26,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' @@ -50,7 +50,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT listing_id AS listing - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS listing__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY listing_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_ratio_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_ratio_metric_in_where_filter__plan0.sql index 6337381e1e..5f009fd2f0 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_ratio_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_ratio_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.bookings_per_booker AS listing__bookings_per_booker + , subq_26.listing__bookings_per_booker AS listing__bookings_per_booker , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings_per_booker'] SELECT subq_25.listing - , subq_25.bookings_per_booker + , subq_25.listing__bookings_per_booker FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , CAST(subq_24.bookings AS DOUBLE) / CAST(NULLIF(subq_24.bookers, 0) AS DOUBLE) AS bookings_per_booker + , CAST(subq_24.bookings AS DOUBLE) / CAST(NULLIF(subq_24.bookers, 0) AS DOUBLE) AS listing__bookings_per_booker FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_simple_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_simple_metric_in_where_filter__plan0.sql index cb0e9a2361..96e4424a81 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_simple_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_simple_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql index d453137357..daf1268c49 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Databricks/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings'] SELECT - subq_26.bookings AS listing__bookings + subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -25,7 +25,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_distinct_values_query_with_metric_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_distinct_values_query_with_metric_filter__plan0.sql index af2d1974cd..5b3e98decc 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_distinct_values_query_with_metric_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_distinct_values_query_with_metric_filter__plan0.sql @@ -14,7 +14,7 @@ FROM ( subq_4.listing AS listing , subq_4.lux_listing AS lux_listing , subq_4.listing__lux_listing AS listing__lux_listing - , subq_10.bookings AS listing__bookings + , subq_10.listing__bookings AS listing__bookings FROM ( -- Read Elements From Semantic Model 'lux_listing_mapping' SELECT @@ -27,12 +27,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_9.listing - , subq_9.bookings + , subq_9.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_8.listing - , subq_8.bookings + , subq_8.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_distinct_values_query_with_metric_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_distinct_values_query_with_metric_filter__plan0_optimized.sql index 28223e439b..fc77fa7686 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_distinct_values_query_with_metric_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_distinct_values_query_with_metric_filter__plan0_optimized.sql @@ -6,7 +6,7 @@ FROM ( -- Join Standard Outputs SELECT lux_listing_mapping_src_28000.listing_id AS listing - , subq_19.bookings AS listing__bookings + , subq_19.listing__bookings AS listing__bookings FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_28000 FULL OUTER JOIN ( -- Aggregate Measures @@ -14,7 +14,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql index 2b315eab94..3a179c91bc 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.booking_value AS guest__booking_value + , subq_12.guest__booking_value AS guest__booking_value , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT subq_11.guest - , subq_11.booking_value + , subq_11.guest__booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.booking_value + , subq_10.booking_value AS guest__booking_value FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql index 53c4da07c1..bbffa182b2 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__booking_value'] SELECT - subq_26.booking_value AS guest__booking_value + subq_26.guest__booking_value AS guest__booking_value , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT guest_id AS guest - , SUM(booking_value) AS booking_value + , SUM(booking_value) AS guest__booking_value FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_filtered_by_itself__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_filtered_by_itself__plan0.sql index 503523e9cd..c2f0d2cd83 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_filtered_by_itself__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_filtered_by_itself__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.bookers AS guest__bookers + , subq_12.guest__bookers AS guest__bookers , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT subq_11.guest - , subq_11.bookers + , subq_11.guest__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.bookers + , subq_10.bookers AS guest__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_filtered_by_itself__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_filtered_by_itself__plan0_optimized.sql index 07a356a39c..8660fddf26 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_filtered_by_itself__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_filtered_by_itself__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__bookers'] SELECT - subq_26.bookers AS guest__bookers + subq_26.guest__bookers AS guest__bookers , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT guest_id AS guest - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS guest__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_with_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_with_metric_in_where_filter__plan0.sql index 575a247d37..aed5a00406 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_with_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_with_metric_in_where_filter__plan0.sql @@ -29,7 +29,7 @@ FROM ( SELECT subq_6.metric_time__day AS metric_time__day , subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing'] @@ -174,12 +174,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_with_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_with_metric_in_where_filter__plan0_optimized.sql index 1ad72fa0ef..5d0f9ae9f7 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_with_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_metric_with_metric_in_where_filter__plan0_optimized.sql @@ -10,7 +10,7 @@ FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing__bookings'] SELECT subq_20.metric_time__day AS metric_time__day - , subq_26.bookings AS listing__bookings + , subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_cumulative_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_cumulative_metric_in_where_filter__plan0.sql index 3a031bcabc..194662f5a6 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_cumulative_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_cumulative_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.user AS user - , subq_12.revenue_all_time AS user__revenue_all_time + , subq_12.user__revenue_all_time AS user__revenue_all_time , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'user'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT subq_11.user - , subq_11.revenue_all_time + , subq_11.user__revenue_all_time FROM ( -- Compute Metrics via Expressions SELECT subq_10.user - , subq_10.txn_revenue AS revenue_all_time + , subq_10.txn_revenue AS user__revenue_all_time FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql index ca59324e35..94fa9f69d0 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'user__revenue_all_time'] SELECT - subq_26.revenue_all_time AS user__revenue_all_time + subq_26.user__revenue_all_time AS user__revenue_all_time , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT user_id AS user - , SUM(revenue) AS revenue_all_time + , SUM(revenue) AS user__revenue_all_time FROM ***************************.fct_revenue revenue_src_28000 GROUP BY user_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_derived_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_derived_metric_in_where_filter__plan0.sql index c0386038eb..a1bf4deca0 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_derived_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_derived_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.views_times_booking_value AS listing__views_times_booking_value + , subq_26.listing__views_times_booking_value AS listing__views_times_booking_value , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT subq_25.listing - , subq_25.views_times_booking_value + , subq_25.listing__views_times_booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql index d91def71f1..d029af6873 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__views_times_booking_value'] SELECT - subq_47.views_times_booking_value AS listing__views_times_booking_value + subq_47.listing__views_times_booking_value AS listing__views_times_booking_value , subq_34.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -24,7 +24,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_multiple_metrics_in_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_multiple_metrics_in_filter__plan0.sql index c8ea694bf4..1a0c7fc391 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_multiple_metrics_in_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_multiple_metrics_in_filter__plan0.sql @@ -25,8 +25,8 @@ FROM ( -- Join Standard Outputs SELECT subq_10.listing AS listing - , subq_16.bookings AS listing__bookings - , subq_22.bookers AS listing__bookers + , subq_16.listing__bookings AS listing__bookings + , subq_22.listing__bookers AS listing__bookers , subq_10.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing', 'listing'] @@ -170,12 +170,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_15.listing - , subq_15.bookings + , subq_15.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_14.listing - , subq_14.bookings + , subq_14.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT @@ -393,12 +393,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT subq_21.listing - , subq_21.bookers + , subq_21.listing__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_20.listing - , subq_20.bookers + , subq_20.bookers AS listing__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql index 746675a7dc..4373c1dcaf 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql @@ -8,8 +8,8 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings', 'listing__bookers'] SELECT - subq_36.bookings AS listing__bookings - , subq_42.bookers AS listing__bookers + subq_36.listing__bookings AS listing__bookings + , subq_42.listing__bookers AS listing__bookers , subq_30.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,7 +26,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' @@ -50,7 +50,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT listing_id AS listing - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS listing__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY listing_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_ratio_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_ratio_metric_in_where_filter__plan0.sql index 32ab73974d..a50ac4eaf1 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_ratio_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_ratio_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.bookings_per_booker AS listing__bookings_per_booker + , subq_26.listing__bookings_per_booker AS listing__bookings_per_booker , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings_per_booker'] SELECT subq_25.listing - , subq_25.bookings_per_booker + , subq_25.listing__bookings_per_booker FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , CAST(subq_24.bookings AS DOUBLE PRECISION) / CAST(NULLIF(subq_24.bookers, 0) AS DOUBLE PRECISION) AS bookings_per_booker + , CAST(subq_24.bookings AS DOUBLE PRECISION) / CAST(NULLIF(subq_24.bookers, 0) AS DOUBLE PRECISION) AS listing__bookings_per_booker FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_simple_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_simple_metric_in_where_filter__plan0.sql index e81b40e399..f76ec704c8 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_simple_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_simple_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql index d453137357..daf1268c49 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Postgres/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings'] SELECT - subq_26.bookings AS listing__bookings + subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -25,7 +25,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_distinct_values_query_with_metric_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_distinct_values_query_with_metric_filter__plan0.sql index b2f9550907..ee9754ef3c 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_distinct_values_query_with_metric_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_distinct_values_query_with_metric_filter__plan0.sql @@ -14,7 +14,7 @@ FROM ( subq_4.listing AS listing , subq_4.lux_listing AS lux_listing , subq_4.listing__lux_listing AS listing__lux_listing - , subq_10.bookings AS listing__bookings + , subq_10.listing__bookings AS listing__bookings FROM ( -- Read Elements From Semantic Model 'lux_listing_mapping' SELECT @@ -27,12 +27,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_9.listing - , subq_9.bookings + , subq_9.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_8.listing - , subq_8.bookings + , subq_8.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_distinct_values_query_with_metric_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_distinct_values_query_with_metric_filter__plan0_optimized.sql index 28223e439b..fc77fa7686 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_distinct_values_query_with_metric_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_distinct_values_query_with_metric_filter__plan0_optimized.sql @@ -6,7 +6,7 @@ FROM ( -- Join Standard Outputs SELECT lux_listing_mapping_src_28000.listing_id AS listing - , subq_19.bookings AS listing__bookings + , subq_19.listing__bookings AS listing__bookings FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_28000 FULL OUTER JOIN ( -- Aggregate Measures @@ -14,7 +14,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql index 5c2e7d3050..3f45ae855c 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.booking_value AS guest__booking_value + , subq_12.guest__booking_value AS guest__booking_value , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT subq_11.guest - , subq_11.booking_value + , subq_11.guest__booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.booking_value + , subq_10.booking_value AS guest__booking_value FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql index 53c4da07c1..bbffa182b2 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__booking_value'] SELECT - subq_26.booking_value AS guest__booking_value + subq_26.guest__booking_value AS guest__booking_value , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT guest_id AS guest - , SUM(booking_value) AS booking_value + , SUM(booking_value) AS guest__booking_value FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_filtered_by_itself__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_filtered_by_itself__plan0.sql index b8fd273929..4f55280ee4 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_filtered_by_itself__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_filtered_by_itself__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.bookers AS guest__bookers + , subq_12.guest__bookers AS guest__bookers , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT subq_11.guest - , subq_11.bookers + , subq_11.guest__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.bookers + , subq_10.bookers AS guest__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_filtered_by_itself__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_filtered_by_itself__plan0_optimized.sql index 07a356a39c..8660fddf26 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_filtered_by_itself__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_filtered_by_itself__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__bookers'] SELECT - subq_26.bookers AS guest__bookers + subq_26.guest__bookers AS guest__bookers , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT guest_id AS guest - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS guest__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_with_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_with_metric_in_where_filter__plan0.sql index 8ea3fc741d..1d01cf449d 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_with_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_with_metric_in_where_filter__plan0.sql @@ -29,7 +29,7 @@ FROM ( SELECT subq_6.metric_time__day AS metric_time__day , subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing'] @@ -174,12 +174,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_with_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_with_metric_in_where_filter__plan0_optimized.sql index 1ad72fa0ef..5d0f9ae9f7 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_with_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_metric_with_metric_in_where_filter__plan0_optimized.sql @@ -10,7 +10,7 @@ FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing__bookings'] SELECT subq_20.metric_time__day AS metric_time__day - , subq_26.bookings AS listing__bookings + , subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_cumulative_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_cumulative_metric_in_where_filter__plan0.sql index b1e0f19764..012e339d10 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_cumulative_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_cumulative_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.user AS user - , subq_12.revenue_all_time AS user__revenue_all_time + , subq_12.user__revenue_all_time AS user__revenue_all_time , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'user'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT subq_11.user - , subq_11.revenue_all_time + , subq_11.user__revenue_all_time FROM ( -- Compute Metrics via Expressions SELECT subq_10.user - , subq_10.txn_revenue AS revenue_all_time + , subq_10.txn_revenue AS user__revenue_all_time FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql index ca59324e35..94fa9f69d0 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'user__revenue_all_time'] SELECT - subq_26.revenue_all_time AS user__revenue_all_time + subq_26.user__revenue_all_time AS user__revenue_all_time , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT user_id AS user - , SUM(revenue) AS revenue_all_time + , SUM(revenue) AS user__revenue_all_time FROM ***************************.fct_revenue revenue_src_28000 GROUP BY user_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_derived_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_derived_metric_in_where_filter__plan0.sql index f79526cb94..a8ce477fc6 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_derived_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_derived_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.views_times_booking_value AS listing__views_times_booking_value + , subq_26.listing__views_times_booking_value AS listing__views_times_booking_value , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT subq_25.listing - , subq_25.views_times_booking_value + , subq_25.listing__views_times_booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql index d91def71f1..d029af6873 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__views_times_booking_value'] SELECT - subq_47.views_times_booking_value AS listing__views_times_booking_value + subq_47.listing__views_times_booking_value AS listing__views_times_booking_value , subq_34.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -24,7 +24,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_multiple_metrics_in_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_multiple_metrics_in_filter__plan0.sql index 4745350f64..5e10ea03d4 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_multiple_metrics_in_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_multiple_metrics_in_filter__plan0.sql @@ -25,8 +25,8 @@ FROM ( -- Join Standard Outputs SELECT subq_10.listing AS listing - , subq_16.bookings AS listing__bookings - , subq_22.bookers AS listing__bookers + , subq_16.listing__bookings AS listing__bookings + , subq_22.listing__bookers AS listing__bookers , subq_10.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing', 'listing'] @@ -170,12 +170,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_15.listing - , subq_15.bookings + , subq_15.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_14.listing - , subq_14.bookings + , subq_14.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT @@ -393,12 +393,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT subq_21.listing - , subq_21.bookers + , subq_21.listing__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_20.listing - , subq_20.bookers + , subq_20.bookers AS listing__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql index 746675a7dc..4373c1dcaf 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql @@ -8,8 +8,8 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings', 'listing__bookers'] SELECT - subq_36.bookings AS listing__bookings - , subq_42.bookers AS listing__bookers + subq_36.listing__bookings AS listing__bookings + , subq_42.listing__bookers AS listing__bookers , subq_30.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,7 +26,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' @@ -50,7 +50,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT listing_id AS listing - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS listing__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY listing_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_ratio_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_ratio_metric_in_where_filter__plan0.sql index 99ae6e6403..90bd1fd2e4 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_ratio_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_ratio_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.bookings_per_booker AS listing__bookings_per_booker + , subq_26.listing__bookings_per_booker AS listing__bookings_per_booker , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings_per_booker'] SELECT subq_25.listing - , subq_25.bookings_per_booker + , subq_25.listing__bookings_per_booker FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , CAST(subq_24.bookings AS DOUBLE PRECISION) / CAST(NULLIF(subq_24.bookers, 0) AS DOUBLE PRECISION) AS bookings_per_booker + , CAST(subq_24.bookings AS DOUBLE PRECISION) / CAST(NULLIF(subq_24.bookers, 0) AS DOUBLE PRECISION) AS listing__bookings_per_booker FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_simple_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_simple_metric_in_where_filter__plan0.sql index bf9dc15d76..3e5c126151 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_simple_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_simple_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql index d453137357..daf1268c49 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Redshift/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings'] SELECT - subq_26.bookings AS listing__bookings + subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -25,7 +25,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_distinct_values_query_with_metric_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_distinct_values_query_with_metric_filter__plan0.sql index 4fb80253ce..5832467cf8 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_distinct_values_query_with_metric_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_distinct_values_query_with_metric_filter__plan0.sql @@ -14,7 +14,7 @@ FROM ( subq_4.listing AS listing , subq_4.lux_listing AS lux_listing , subq_4.listing__lux_listing AS listing__lux_listing - , subq_10.bookings AS listing__bookings + , subq_10.listing__bookings AS listing__bookings FROM ( -- Read Elements From Semantic Model 'lux_listing_mapping' SELECT @@ -27,12 +27,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_9.listing - , subq_9.bookings + , subq_9.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_8.listing - , subq_8.bookings + , subq_8.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_distinct_values_query_with_metric_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_distinct_values_query_with_metric_filter__plan0_optimized.sql index 28223e439b..fc77fa7686 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_distinct_values_query_with_metric_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_distinct_values_query_with_metric_filter__plan0_optimized.sql @@ -6,7 +6,7 @@ FROM ( -- Join Standard Outputs SELECT lux_listing_mapping_src_28000.listing_id AS listing - , subq_19.bookings AS listing__bookings + , subq_19.listing__bookings AS listing__bookings FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_28000 FULL OUTER JOIN ( -- Aggregate Measures @@ -14,7 +14,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql index 5c3fae60e3..fdfc7bdaf8 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.booking_value AS guest__booking_value + , subq_12.guest__booking_value AS guest__booking_value , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT subq_11.guest - , subq_11.booking_value + , subq_11.guest__booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.booking_value + , subq_10.booking_value AS guest__booking_value FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql index 53c4da07c1..bbffa182b2 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__booking_value'] SELECT - subq_26.booking_value AS guest__booking_value + subq_26.guest__booking_value AS guest__booking_value , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT guest_id AS guest - , SUM(booking_value) AS booking_value + , SUM(booking_value) AS guest__booking_value FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_filtered_by_itself__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_filtered_by_itself__plan0.sql index 8f5a9dfcae..d002278acc 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_filtered_by_itself__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_filtered_by_itself__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.bookers AS guest__bookers + , subq_12.guest__bookers AS guest__bookers , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT subq_11.guest - , subq_11.bookers + , subq_11.guest__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.bookers + , subq_10.bookers AS guest__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_filtered_by_itself__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_filtered_by_itself__plan0_optimized.sql index 07a356a39c..8660fddf26 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_filtered_by_itself__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_filtered_by_itself__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__bookers'] SELECT - subq_26.bookers AS guest__bookers + subq_26.guest__bookers AS guest__bookers , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT guest_id AS guest - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS guest__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_with_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_with_metric_in_where_filter__plan0.sql index ddd96ba34e..e42b014233 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_with_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_with_metric_in_where_filter__plan0.sql @@ -29,7 +29,7 @@ FROM ( SELECT subq_6.metric_time__day AS metric_time__day , subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing'] @@ -174,12 +174,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_with_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_with_metric_in_where_filter__plan0_optimized.sql index 1ad72fa0ef..5d0f9ae9f7 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_with_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_metric_with_metric_in_where_filter__plan0_optimized.sql @@ -10,7 +10,7 @@ FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing__bookings'] SELECT subq_20.metric_time__day AS metric_time__day - , subq_26.bookings AS listing__bookings + , subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_cumulative_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_cumulative_metric_in_where_filter__plan0.sql index 4a8be0eb39..9a417bb280 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_cumulative_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_cumulative_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.user AS user - , subq_12.revenue_all_time AS user__revenue_all_time + , subq_12.user__revenue_all_time AS user__revenue_all_time , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'user'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT subq_11.user - , subq_11.revenue_all_time + , subq_11.user__revenue_all_time FROM ( -- Compute Metrics via Expressions SELECT subq_10.user - , subq_10.txn_revenue AS revenue_all_time + , subq_10.txn_revenue AS user__revenue_all_time FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql index ca59324e35..94fa9f69d0 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'user__revenue_all_time'] SELECT - subq_26.revenue_all_time AS user__revenue_all_time + subq_26.user__revenue_all_time AS user__revenue_all_time , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT user_id AS user - , SUM(revenue) AS revenue_all_time + , SUM(revenue) AS user__revenue_all_time FROM ***************************.fct_revenue revenue_src_28000 GROUP BY user_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_derived_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_derived_metric_in_where_filter__plan0.sql index 048baa40f7..d319d96b6c 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_derived_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_derived_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.views_times_booking_value AS listing__views_times_booking_value + , subq_26.listing__views_times_booking_value AS listing__views_times_booking_value , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT subq_25.listing - , subq_25.views_times_booking_value + , subq_25.listing__views_times_booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql index d91def71f1..d029af6873 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__views_times_booking_value'] SELECT - subq_47.views_times_booking_value AS listing__views_times_booking_value + subq_47.listing__views_times_booking_value AS listing__views_times_booking_value , subq_34.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -24,7 +24,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_multiple_metrics_in_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_multiple_metrics_in_filter__plan0.sql index f39ce2d2b2..2b552053fc 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_multiple_metrics_in_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_multiple_metrics_in_filter__plan0.sql @@ -25,8 +25,8 @@ FROM ( -- Join Standard Outputs SELECT subq_10.listing AS listing - , subq_16.bookings AS listing__bookings - , subq_22.bookers AS listing__bookers + , subq_16.listing__bookings AS listing__bookings + , subq_22.listing__bookers AS listing__bookers , subq_10.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing', 'listing'] @@ -170,12 +170,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_15.listing - , subq_15.bookings + , subq_15.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_14.listing - , subq_14.bookings + , subq_14.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT @@ -393,12 +393,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT subq_21.listing - , subq_21.bookers + , subq_21.listing__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_20.listing - , subq_20.bookers + , subq_20.bookers AS listing__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql index 746675a7dc..4373c1dcaf 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql @@ -8,8 +8,8 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings', 'listing__bookers'] SELECT - subq_36.bookings AS listing__bookings - , subq_42.bookers AS listing__bookers + subq_36.listing__bookings AS listing__bookings + , subq_42.listing__bookers AS listing__bookers , subq_30.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,7 +26,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' @@ -50,7 +50,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT listing_id AS listing - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS listing__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY listing_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_ratio_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_ratio_metric_in_where_filter__plan0.sql index 0ba8359672..f70d45f32f 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_ratio_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_ratio_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.bookings_per_booker AS listing__bookings_per_booker + , subq_26.listing__bookings_per_booker AS listing__bookings_per_booker , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings_per_booker'] SELECT subq_25.listing - , subq_25.bookings_per_booker + , subq_25.listing__bookings_per_booker FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , CAST(subq_24.bookings AS DOUBLE) / CAST(NULLIF(subq_24.bookers, 0) AS DOUBLE) AS bookings_per_booker + , CAST(subq_24.bookings AS DOUBLE) / CAST(NULLIF(subq_24.bookers, 0) AS DOUBLE) AS listing__bookings_per_booker FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_simple_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_simple_metric_in_where_filter__plan0.sql index fdefd2fd91..5c4e575293 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_simple_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_simple_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql index d453137357..daf1268c49 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Snowflake/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings'] SELECT - subq_26.bookings AS listing__bookings + subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -25,7 +25,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_distinct_values_query_with_metric_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_distinct_values_query_with_metric_filter__plan0.sql index 3d30080128..88b536d908 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_distinct_values_query_with_metric_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_distinct_values_query_with_metric_filter__plan0.sql @@ -14,7 +14,7 @@ FROM ( subq_4.listing AS listing , subq_4.lux_listing AS lux_listing , subq_4.listing__lux_listing AS listing__lux_listing - , subq_10.bookings AS listing__bookings + , subq_10.listing__bookings AS listing__bookings FROM ( -- Read Elements From Semantic Model 'lux_listing_mapping' SELECT @@ -27,12 +27,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_9.listing - , subq_9.bookings + , subq_9.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_8.listing - , subq_8.bookings + , subq_8.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_distinct_values_query_with_metric_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_distinct_values_query_with_metric_filter__plan0_optimized.sql index 28223e439b..fc77fa7686 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_distinct_values_query_with_metric_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_distinct_values_query_with_metric_filter__plan0_optimized.sql @@ -6,7 +6,7 @@ FROM ( -- Join Standard Outputs SELECT lux_listing_mapping_src_28000.listing_id AS listing - , subq_19.bookings AS listing__bookings + , subq_19.listing__bookings AS listing__bookings FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_28000 FULL OUTER JOIN ( -- Aggregate Measures @@ -14,7 +14,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql index b2adf7f41e..efa1b2b2fa 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.booking_value AS guest__booking_value + , subq_12.guest__booking_value AS guest__booking_value , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT subq_11.guest - , subq_11.booking_value + , subq_11.guest__booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.booking_value + , subq_10.booking_value AS guest__booking_value FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql index 53c4da07c1..bbffa182b2 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__booking_value'] SELECT - subq_26.booking_value AS guest__booking_value + subq_26.guest__booking_value AS guest__booking_value , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__booking_value'] SELECT guest_id AS guest - , SUM(booking_value) AS booking_value + , SUM(booking_value) AS guest__booking_value FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_filtered_by_itself__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_filtered_by_itself__plan0.sql index 3465cd0d76..150eb321d4 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_filtered_by_itself__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_filtered_by_itself__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.guest AS guest - , subq_12.bookers AS guest__bookers + , subq_12.guest__bookers AS guest__bookers , subq_6.bookers AS bookers FROM ( -- Pass Only Elements: ['bookers', 'guest'] @@ -230,12 +230,12 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT subq_11.guest - , subq_11.bookers + , subq_11.guest__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_10.guest - , subq_10.bookers + , subq_10.bookers AS guest__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_filtered_by_itself__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_filtered_by_itself__plan0_optimized.sql index 07a356a39c..8660fddf26 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_filtered_by_itself__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_filtered_by_itself__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['bookers', 'guest__bookers'] SELECT - subq_26.bookers AS guest__bookers + subq_26.guest__bookers AS guest__bookers , subq_20.bookers AS bookers FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['guest', 'guest__bookers'] SELECT guest_id AS guest - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS guest__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY guest_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_with_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_with_metric_in_where_filter__plan0.sql index 36f6b57c8a..cf6fce632c 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_with_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_with_metric_in_where_filter__plan0.sql @@ -29,7 +29,7 @@ FROM ( SELECT subq_6.metric_time__day AS metric_time__day , subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing'] @@ -174,12 +174,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_with_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_with_metric_in_where_filter__plan0_optimized.sql index 1ad72fa0ef..5d0f9ae9f7 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_with_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_metric_with_metric_in_where_filter__plan0_optimized.sql @@ -10,7 +10,7 @@ FROM ( -- Pass Only Elements: ['listings', 'metric_time__day', 'listing__bookings'] SELECT subq_20.metric_time__day AS metric_time__day - , subq_26.bookings AS listing__bookings + , subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_cumulative_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_cumulative_metric_in_where_filter__plan0.sql index 5ec171933b..dc55a381b5 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_cumulative_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_cumulative_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.user AS user - , subq_12.revenue_all_time AS user__revenue_all_time + , subq_12.user__revenue_all_time AS user__revenue_all_time , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'user'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT subq_11.user - , subq_11.revenue_all_time + , subq_11.user__revenue_all_time FROM ( -- Compute Metrics via Expressions SELECT subq_10.user - , subq_10.txn_revenue AS revenue_all_time + , subq_10.txn_revenue AS user__revenue_all_time FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql index ca59324e35..94fa9f69d0 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'user__revenue_all_time'] SELECT - subq_26.revenue_all_time AS user__revenue_all_time + subq_26.user__revenue_all_time AS user__revenue_all_time , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -28,7 +28,7 @@ FROM ( -- Pass Only Elements: ['user', 'user__revenue_all_time'] SELECT user_id AS user - , SUM(revenue) AS revenue_all_time + , SUM(revenue) AS user__revenue_all_time FROM ***************************.fct_revenue revenue_src_28000 GROUP BY user_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_derived_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_derived_metric_in_where_filter__plan0.sql index 8c283e141c..e054300a84 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_derived_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_derived_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.views_times_booking_value AS listing__views_times_booking_value + , subq_26.listing__views_times_booking_value AS listing__views_times_booking_value , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT subq_25.listing - , subq_25.views_times_booking_value + , subq_25.listing__views_times_booking_value FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql index d91def71f1..d029af6873 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__views_times_booking_value'] SELECT - subq_47.views_times_booking_value AS listing__views_times_booking_value + subq_47.listing__views_times_booking_value AS listing__views_times_booking_value , subq_34.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -24,7 +24,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__views_times_booking_value'] SELECT listing - , booking_value * views AS views_times_booking_value + , booking_value * views AS listing__views_times_booking_value FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_multiple_metrics_in_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_multiple_metrics_in_filter__plan0.sql index 123b9474cc..b778242996 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_multiple_metrics_in_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_multiple_metrics_in_filter__plan0.sql @@ -25,8 +25,8 @@ FROM ( -- Join Standard Outputs SELECT subq_10.listing AS listing - , subq_16.bookings AS listing__bookings - , subq_22.bookers AS listing__bookers + , subq_16.listing__bookings AS listing__bookings + , subq_22.listing__bookers AS listing__bookers , subq_10.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing', 'listing'] @@ -170,12 +170,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_15.listing - , subq_15.bookings + , subq_15.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_14.listing - , subq_14.bookings + , subq_14.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT @@ -393,12 +393,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT subq_21.listing - , subq_21.bookers + , subq_21.listing__bookers FROM ( -- Compute Metrics via Expressions SELECT subq_20.listing - , subq_20.bookers + , subq_20.bookers AS listing__bookers FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql index 746675a7dc..4373c1dcaf 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql @@ -8,8 +8,8 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings', 'listing__bookers'] SELECT - subq_36.bookings AS listing__bookings - , subq_42.bookers AS listing__bookers + subq_36.listing__bookings AS listing__bookings + , subq_42.listing__bookers AS listing__bookers , subq_30.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,7 +26,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds' @@ -50,7 +50,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookers'] SELECT listing_id AS listing - , COUNT(DISTINCT guest_id) AS bookers + , COUNT(DISTINCT guest_id) AS listing__bookers FROM ***************************.fct_bookings bookings_source_src_28000 GROUP BY listing_id diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_ratio_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_ratio_metric_in_where_filter__plan0.sql index 9da066ab7d..e13c570bf3 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_ratio_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_ratio_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_13.listing AS listing - , subq_26.bookings_per_booker AS listing__bookings_per_booker + , subq_26.listing__bookings_per_booker AS listing__bookings_per_booker , subq_13.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings_per_booker'] SELECT subq_25.listing - , subq_25.bookings_per_booker + , subq_25.listing__bookings_per_booker FROM ( -- Compute Metrics via Expressions SELECT subq_24.listing - , CAST(subq_24.bookings AS DOUBLE) / CAST(NULLIF(subq_24.bookers, 0) AS DOUBLE) AS bookings_per_booker + , CAST(subq_24.bookings AS DOUBLE) / CAST(NULLIF(subq_24.bookers, 0) AS DOUBLE) AS listing__bookings_per_booker FROM ( -- Combine Aggregated Outputs SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_simple_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_simple_metric_in_where_filter__plan0.sql index f06107baa5..6fa974a0c3 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_simple_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_simple_metric_in_where_filter__plan0.sql @@ -23,7 +23,7 @@ FROM ( -- Join Standard Outputs SELECT subq_6.listing AS listing - , subq_12.bookings AS listing__bookings + , subq_12.listing__bookings AS listing__bookings , subq_6.listings AS listings FROM ( -- Pass Only Elements: ['listings', 'listing'] @@ -167,12 +167,12 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT subq_11.listing - , subq_11.bookings + , subq_11.listing__bookings FROM ( -- Compute Metrics via Expressions SELECT subq_10.listing - , subq_10.bookings + , subq_10.bookings AS listing__bookings FROM ( -- Aggregate Measures SELECT diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql index d453137357..daf1268c49 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/Trino/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Join Standard Outputs -- Pass Only Elements: ['listings', 'listing__bookings'] SELECT - subq_26.bookings AS listing__bookings + subq_26.listing__bookings AS listing__bookings , subq_20.listings AS listings FROM ( -- Read Elements From Semantic Model 'listings_latest' @@ -25,7 +25,7 @@ FROM ( -- Pass Only Elements: ['listing', 'listing__bookings'] SELECT listing - , SUM(bookings) AS bookings + , SUM(bookings) AS listing__bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' -- Metric Time Dimension 'ds'