diff --git a/metricflow-semantics/metricflow_semantics/specs/dunder_column_association_resolver.py b/metricflow-semantics/metricflow_semantics/specs/dunder_column_association_resolver.py index d217067646..69c0cc0b26 100644 --- a/metricflow-semantics/metricflow_semantics/specs/dunder_column_association_resolver.py +++ b/metricflow-semantics/metricflow_semantics/specs/dunder_column_association_resolver.py @@ -1,7 +1,7 @@ from __future__ import annotations from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup -from metricflow_semantics.naming.linkable_spec_name import DUNDER, StructuredLinkableSpecName +from metricflow_semantics.naming.linkable_spec_name import DUNDER from metricflow_semantics.specs.column_assoc import ( ColumnAssociation, ColumnAssociationResolver, @@ -59,23 +59,13 @@ def visit_measure_spec(self, measure_spec: MeasureSpec) -> ColumnAssociation: # def visit_dimension_spec(self, dimension_spec: DimensionSpec) -> ColumnAssociation: # noqa: D102 return ColumnAssociation( - column_name=StructuredLinkableSpecName( - entity_link_names=tuple(x.element_name for x in dimension_spec.entity_links), - element_name=dimension_spec.element_name, - ).qualified_name, + column_name=dimension_spec.qualified_name, single_column_correlation_key=SingleColumnCorrelationKey(), ) def visit_time_dimension_spec(self, time_dimension_spec: TimeDimensionSpec) -> ColumnAssociation: # noqa: D102 - column_name = StructuredLinkableSpecName( - entity_link_names=tuple(x.element_name for x in time_dimension_spec.entity_links), - element_name=time_dimension_spec.element_name, - time_granularity=time_dimension_spec.time_granularity, - date_part=time_dimension_spec.date_part, - ).qualified_name - return ColumnAssociation( - column_name=column_name + column_name=time_dimension_spec.qualified_name + ( f"{DUNDER}{time_dimension_spec.aggregation_state.value.lower()}" if time_dimension_spec.aggregation_state @@ -86,19 +76,13 @@ def visit_time_dimension_spec(self, time_dimension_spec: TimeDimensionSpec) -> C def visit_entity_spec(self, entity_spec: EntitySpec) -> ColumnAssociation: # noqa: D102 return ColumnAssociation( - column_name=StructuredLinkableSpecName( - entity_link_names=tuple(x.element_name for x in entity_spec.entity_links), - element_name=entity_spec.element_name, - ).qualified_name, + column_name=entity_spec.qualified_name, single_column_correlation_key=SingleColumnCorrelationKey(), ) def visit_group_by_metric_spec(self, group_by_metric_spec: GroupByMetricSpec) -> ColumnAssociation: # noqa: D102 return ColumnAssociation( - column_name=StructuredLinkableSpecName( - entity_link_names=tuple(x.element_name for x in group_by_metric_spec.entity_links), - element_name=group_by_metric_spec.element_name, - ).qualified_name, + column_name=group_by_metric_spec.qualified_name, single_column_correlation_key=SingleColumnCorrelationKey(), ) diff --git a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values_query_with_metric_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values_query_with_metric_filter__plan0.sql index af2d1974cd..5b3e98decc 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values_query_with_metric_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_distinct_values_query_with_metric_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values_query_with_metric_filter__plan0_optimized.sql index 28223e439b..fc77fa7686 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values_query_with_metric_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_filter_by_metric_in_same_semantic_model_as_queried_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_filtered_by_itself__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_metric_filtered_by_itself__plan0.sql index 503523e9cd..c2f0d2cd83 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_metric_filtered_by_itself__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_filtered_by_itself__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_metric_filtered_by_itself__plan0_optimized.sql index 07a356a39c..8660fddf26 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_metric_filtered_by_itself__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_with_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_metric_in_where_filter__plan0.sql index 575a247d37..aed5a00406 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_with_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_metric_in_where_filter__plan0_optimized.sql index 1ad72fa0ef..5d0f9ae9f7 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_cumulative_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_cumulative_metric_in_where_filter__plan0.sql index 3a031bcabc..194662f5a6 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_cumulative_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_cumulative_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_derived_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_derived_metric_in_where_filter__plan0.sql index c0386038eb..a1bf4deca0 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_derived_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_derived_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_multiple_metrics_in_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_multiple_metrics_in_filter__plan0.sql index c8ea694bf4..1a0c7fc391 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_multiple_metrics_in_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql index 746675a7dc..4373c1dcaf 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_multiple_metrics_in_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_ratio_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_ratio_metric_in_where_filter__plan0.sql index 83ffdd692a..6736e566c6 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_ratio_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_simple_metric_in_where_filter__plan0.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_simple_metric_in_where_filter__plan0.sql index e81b40e399..f76ec704c8 100644 --- a/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/test_query_with_simple_metric_in_where_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_query_with_simple_metric_in_where_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_filter_rendering.py/SqlQueryPlan/DuckDB/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'