From 57fc8ecb6bb583f0a179ce3b9f2cb64cc21a19c2 Mon Sep 17 00:00:00 2001 From: William Deng Date: Tue, 17 Jan 2023 17:27:37 -0500 Subject: [PATCH] updated snapshots --- .../test_cases/itest_conversion_metrics.yaml | 10 +- .../test_convert_query_data_source__plan0.sql | 16 +- ...table_data_source_with_measures__plan0.sql | 52 +- ...le_data_source_without_measures__plan0.sql | 28 +- .../test_convert_query_data_source__plan0.sql | 16 +- ...table_data_source_with_measures__plan0.sql | 52 +- ...le_data_source_without_measures__plan0.sql | 28 +- .../test_common_data_source__dfp_0.xml | 12 +- .../test_cumulative_metric__dfp_0.xml | 4 +- .../test_distinct_values_plan__dfp_0.xml | 6 +- .../test_expr_metrics_plan__dfp_0.xml | 6 +- .../DataflowPlan/test_joined_plan__dfp_0.xml | 6 +- .../test_limit_rows_plan__dfp_0.xml | 2 +- .../test_measure_constraint_plan__dfp_0.xml | 8 +- ...traint_with_reused_measure_plan__dfp_0.xml | 4 +- ..._data_source_ratio_metrics_plan__dfp_0.xml | 14 +- .../test_multihop_join_plan__dfp_0.xml | 8 +- .../test_multiple_metrics_plan__dfp_0.xml | 4 +- .../test_order_by_plan__dfp_0.xml | 2 +- .../DataflowPlan/test_simple_plan__dfp_0.xml | 2 +- ..._data_source_ratio_metrics_plan__dfp_0.xml | 6 +- .../test_where_constrained_plan__dfp_0.xml | 6 +- ...constrained_plan_time_dimension__dfp_0.xml | 2 +- ...ained_with_common_linkable_plan__dfp_0.xml | 6 +- .../test_joined_plan__ep_0.xml | 8 +- .../test_multihop_joined_plan__ep_0.xml | 22 +- .../test_joined_plan__ep_0.xml | 8 +- .../test_multihop_joined_plan__ep_0.xml | 22 +- ...ompute_metrics_node_simple_expr__plan0.xml | 2 +- .../test_composite_identifier__plan0.sql | 36 +- ..._composite_identifier__plan0_optimized.sql | 2 +- ..._composite_identifier_with_join__plan0.sql | 124 ++-- ..._identifier_with_join__plan0_optimized.sql | 12 +- ...posite_identifier_with_order_by__plan0.sql | 36 +- ...ntifier_with_order_by__plan0_optimized.sql | 2 +- .../test_compute_metrics_node__plan0.sql | 64 +- ..._compute_metrics_node__plan0_optimized.sql | 8 +- ...atio_from_multiple_data_sources__plan0.sql | 180 ++--- ...multiple_data_sources__plan0_optimized.sql | 18 +- ...e_ratio_from_single_data_source__plan0.sql | 64 +- ...om_single_data_source__plan0_optimized.sql | 8 +- ...ompute_metrics_node_simple_expr__plan0.sql | 64 +- ...rics_node_simple_expr__plan0_optimized.sql | 8 +- .../test_cumulative_metric__plan0.sql | 16 +- ...est_cumulative_metric__plan0_optimized.sql | 2 +- ...cumulative_metric_grain_to_date__plan0.sql | 16 +- ..._metric_grain_to_date__plan0_optimized.sql | 2 +- .../test_cumulative_metric_no_ds__plan0.sql | 16 +- ...mulative_metric_no_ds__plan0_optimized.sql | 2 +- ...est_cumulative_metric_no_window__plan0.sql | 16 +- ...tive_metric_no_window__plan0_optimized.sql | 2 +- ..._no_window_with_time_constraint__plan0.sql | 16 +- ..._with_time_constraint__plan0_optimized.sql | 2 +- ...ive_metric_with_time_constraint__plan0.sql | 16 +- ..._with_time_constraint__plan0_optimized.sql | 2 +- .../test_distinct_values__plan0.sql | 64 +- .../test_distinct_values__plan0_optimized.sql | 8 +- ...th_where_constraint_on_join_dim__plan0.sql | 64 +- ...onstraint_on_join_dim__plan0_optimized.sql | 6 +- ...est_join_conversion_events_node__plan0.sql | 83 +++ ...onversion_events_node__plan0_optimized.sql | 67 ++ .../test_join_to_scd_dimension__plan0.sql | 110 +-- ...join_to_scd_dimension__plan0_optimized.sql | 14 +- ...imension_using_local_identifier__plan0.sql | 64 +- ...sing_local_identifier__plan0_optimized.sql | 2 +- .../test_measure_constraint__plan0.sql | 64 +- ...st_measure_constraint__plan0_optimized.sql | 6 +- ..._multiple_sources_no_dimensions__plan0.sql | 64 +- ...sources_no_dimensions__plan0_optimized.sql | 2 +- ...multi_hop_through_scd_dimension__plan0.sql | 138 ++-- ...through_scd_dimension__plan0_optimized.sql | 16 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 106 +-- ..._hop_to_scd_dimension__plan0_optimized.sql | 16 +- .../test_multi_join_node__plan0.sql | 128 ++-- .../test_multi_join_node__plan0_optimized.sql | 4 +- .../test_multihop_node__plan0.sql | 114 +-- .../test_multihop_node__plan0_optimized.sql | 22 +- ..._multiple_metrics_no_dimensions__plan0.sql | 64 +- ...metrics_no_dimensions__plan0_optimized.sql | 2 +- .../test_partitioned_join__plan0.sql | 120 +-- ...test_partitioned_join__plan0_optimized.sql | 12 +- .../test_single_join_node__plan0.sql | 64 +- ...test_single_join_node__plan0_optimized.sql | 6 +- .../test_composite_identifier__plan0.sql | 36 +- ..._composite_identifier__plan0_optimized.sql | 2 +- ..._composite_identifier_with_join__plan0.sql | 124 ++-- ..._identifier_with_join__plan0_optimized.sql | 12 +- ...posite_identifier_with_order_by__plan0.sql | 36 +- ...ntifier_with_order_by__plan0_optimized.sql | 2 +- .../test_compute_metrics_node__plan0.sql | 64 +- ..._compute_metrics_node__plan0_optimized.sql | 8 +- ...atio_from_multiple_data_sources__plan0.sql | 180 ++--- ...multiple_data_sources__plan0_optimized.sql | 18 +- ...e_ratio_from_single_data_source__plan0.sql | 64 +- ...om_single_data_source__plan0_optimized.sql | 8 +- ...ompute_metrics_node_simple_expr__plan0.sql | 64 +- ...rics_node_simple_expr__plan0_optimized.sql | 8 +- .../test_cumulative_metric__plan0.sql | 16 +- ...est_cumulative_metric__plan0_optimized.sql | 2 +- ...cumulative_metric_grain_to_date__plan0.sql | 16 +- ..._metric_grain_to_date__plan0_optimized.sql | 2 +- .../test_cumulative_metric_no_ds__plan0.sql | 16 +- ...mulative_metric_no_ds__plan0_optimized.sql | 2 +- ...est_cumulative_metric_no_window__plan0.sql | 16 +- ...tive_metric_no_window__plan0_optimized.sql | 2 +- ..._no_window_with_time_constraint__plan0.sql | 16 +- ..._with_time_constraint__plan0_optimized.sql | 2 +- ...ive_metric_with_time_constraint__plan0.sql | 16 +- ..._with_time_constraint__plan0_optimized.sql | 2 +- .../test_distinct_values__plan0.sql | 64 +- .../test_distinct_values__plan0_optimized.sql | 8 +- ...th_where_constraint_on_join_dim__plan0.sql | 64 +- ...onstraint_on_join_dim__plan0_optimized.sql | 6 +- ...est_join_conversion_events_node__plan0.sql | 83 +++ ...onversion_events_node__plan0_optimized.sql | 67 ++ .../test_join_to_scd_dimension__plan0.sql | 110 +-- ...join_to_scd_dimension__plan0_optimized.sql | 14 +- ...imension_using_local_identifier__plan0.sql | 64 +- ...sing_local_identifier__plan0_optimized.sql | 2 +- .../test_measure_constraint__plan0.sql | 64 +- ...st_measure_constraint__plan0_optimized.sql | 6 +- ..._multiple_sources_no_dimensions__plan0.sql | 64 +- ...sources_no_dimensions__plan0_optimized.sql | 2 +- ...multi_hop_through_scd_dimension__plan0.sql | 138 ++-- ...through_scd_dimension__plan0_optimized.sql | 16 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 106 +-- ..._hop_to_scd_dimension__plan0_optimized.sql | 16 +- .../test_multi_join_node__plan0.sql | 128 ++-- .../test_multi_join_node__plan0_optimized.sql | 4 +- .../test_multihop_node__plan0.sql | 114 +-- .../test_multihop_node__plan0_optimized.sql | 22 +- ..._multiple_metrics_no_dimensions__plan0.sql | 64 +- ...metrics_no_dimensions__plan0_optimized.sql | 2 +- .../test_partitioned_join__plan0.sql | 120 +-- ...test_partitioned_join__plan0_optimized.sql | 12 +- .../test_single_join_node__plan0.sql | 64 +- ...test_single_join_node__plan0_optimized.sql | 6 +- .../test_common_data_source__plan0.xml | 297 ++++---- .../test_composite_identifier__plan0.xml | 45 +- ..._composite_identifier_with_join__plan0.xml | 139 ++-- ...posite_identifier_with_order_by__plan0.xml | 46 +- .../test_compute_metrics_node__plan0.xml | 75 +- ...atio_from_multiple_data_sources__plan0.xml | 691 +++++++++--------- ...e_ratio_from_single_data_source__plan0.xml | 75 +- ...ompute_metrics_node_simple_expr__plan0.xml | 75 +- .../test_constrain_time_range_node__plan0.xml | 4 + .../test_cumulative_metric__plan0.xml | 77 +- ...cumulative_metric_grain_to_date__plan0.xml | 77 +- .../test_cumulative_metric_no_ds__plan0.xml | 69 +- ...est_cumulative_metric_no_window__plan0.xml | 77 +- ..._no_window_with_time_constraint__plan0.xml | 106 +-- ...ive_metric_with_time_constraint__plan0.xml | 106 +-- .../test_derived_metric__plan0.xml | 308 ++++---- ...ved_metric_with_offset_to_grain__plan0.xml | 324 ++++---- ...rived_metric_with_offset_window__plan0.xml | 324 ++++---- ...fset_window_and_offset_to_grain__plan0.xml | 340 +++++---- ...ed_metric_with_one_input_metric__plan0.xml | 168 +++-- .../test_distinct_values__plan0.xml | 338 ++++----- .../SqlQueryPlan/test_filter_node__plan0.xml | 2 + ...lter_with_where_constraint_node__plan0.xml | 3 + ...th_where_constraint_on_join_dim__plan0.xml | 348 ++++----- ...est_join_conversion_events_node__plan0.xml | 241 ++++++ .../test_join_to_scd_dimension__plan0.xml | 129 ++-- ...spine_node_with_offset_to_grain__plan0.xml | 7 + ...e_spine_node_with_offset_window__plan0.xml | 7 + ..._time_spine_node_without_offset__plan0.xml | 7 + .../SqlQueryPlan/test_limit_rows__plan0.xml | 154 ++-- ...imension_using_local_identifier__plan0.xml | 173 ++--- .../test_measure_aggregation_node__plan0.xml | 3 + .../test_measure_constraint__plan0.xml | 520 ++++++------- ..._constraint_with_reused_measure__plan0.xml | 325 ++++---- ...aint_with_single_expr_and_alias__plan0.xml | 165 +++-- ..._multiple_sources_no_dimensions__plan0.xml | 313 ++++---- ...multi_hop_through_scd_dimension__plan0.xml | 160 ++-- ...test_multi_hop_to_scd_dimension__plan0.xml | 128 ++-- .../test_multi_join_node__plan0.xml | 143 ++-- .../test_multihop_node__plan0.xml | 132 ++-- ..._multiple_metrics_no_dimensions__plan0.xml | 507 ++++++------- .../test_nested_derived_metric__plan0.xml | 620 ++++++++-------- .../test_order_by_node__plan0.xml | 5 + .../test_partitioned_join__plan0.xml | 267 +++---- .../test_semi_additive_join_node__plan0.xml | 4 + ...dditive_join_node_with_grouping__plan0.xml | 4 + ...join_node_with_queried_group_by__plan0.xml | 4 + .../test_single_join_node__plan0.xml | 73 +- .../SqlQueryPlan/test_source_node__plan0.xml | 1 + ...orm_node_using_non_primary_time__plan0.xml | 2 + ...ansform_node_using_primary_time__plan0.xml | 2 + ...uery_with_metric_time_dimension__plan0.xml | 273 +++---- ...st_2_metrics_from_1_data_source__dfp_0.xml | 12 +- ...t_2_metrics_from_2_data_sources__dfp_0.xml | 6 +- ...atio_metrics_from_1_data_source__dfp_0.xml | 4 +- ...t_3_metrics_from_2_data_sources__dfp_0.xml | 8 +- ...constrained_metric_not_combined__dfp_0.xml | 4 +- .../test_derived_metric__dfp_0.xml | 4 +- ..._metric_with_non_derived_metric__dfp_0.xml | 6 +- .../test_nested_derived_metric__dfp_0.xml | 8 +- 197 files changed, 7095 insertions(+), 6130 deletions(-) create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_conversion_events_node__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_conversion_events_node__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_conversion_events_node__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_conversion_events_node__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_conversion_events_node__plan0.xml diff --git a/metricflow/test/integration/test_cases/itest_conversion_metrics.yaml b/metricflow/test/integration/test_cases/itest_conversion_metrics.yaml index 9a186bc650..5a153e8130 100644 --- a/metricflow/test/integration/test_cases/itest_conversion_metrics.yaml +++ b/metricflow/test/integration/test_cases/itest_conversion_metrics.yaml @@ -80,7 +80,7 @@ integration_test: SELECT *, {{ generate_random_uuid() }} AS uuid FROM {{ source_schema }}.fct_buys ) buy_source ON - v.user_id = buy_source.user_id AND v.ds <= buy_source.ds AND v.ds > buy_source.ds - INTERVAL 7 day + v.user_id = buy_source.user_id AND v.ds <= buy_source.ds AND v.ds > {{ render_date_sub("buy_source", "ds", 7, TimeGranularity.DAY) }} ) b GROUP BY b.referrer_id @@ -125,7 +125,7 @@ integration_test: SELECT *, {{ generate_random_uuid() }} AS uuid FROM {{ source_schema }}.fct_buys ) buy_source ON - v.user_id = buy_source.user_id AND v.ds <= buy_source.ds AND v.ds > buy_source.ds - INTERVAL 7 day + v.user_id = buy_source.user_id AND v.ds <= buy_source.ds AND v.ds > {{ render_date_sub("buy_source", "ds", 7, TimeGranularity.DAY) }} ) b GROUP BY b.referrer_id, b.ds @@ -158,7 +158,7 @@ integration_test: SELECT *, {{ generate_random_uuid() }} AS uuid FROM {{ source_schema }}.fct_buys ) buy_source ON - v.user_id = buy_source.user_id AND v.ds <= buy_source.ds AND v.ds > buy_source.ds - INTERVAL 7 day + v.user_id = buy_source.user_id AND v.ds <= buy_source.ds AND v.ds > {{ render_date_sub("buy_source", "ds", 7, TimeGranularity.DAY) }} ) b GROUP BY b.ds @@ -190,7 +190,7 @@ integration_test: SELECT *, {{ generate_random_uuid() }} AS uuid FROM {{ source_schema }}.fct_buys ) buy_source ON - v.user_id = buy_source.user_id AND v.ds <= buy_source.ds AND v.ds > buy_source.ds - INTERVAL 7 day + v.user_id = buy_source.user_id AND v.ds <= buy_source.ds AND v.ds > {{ render_date_sub("buy_source", "ds", 7, TimeGranularity.DAY) }} ) b GROUP BY b.referrer_id @@ -223,7 +223,7 @@ integration_test: SELECT *, {{ generate_random_uuid() }} AS uuid FROM {{ source_schema }}.fct_buys ) buy_source ON - v.user_id = buy_source.user_id AND v.ds <= buy_source.ds AND v.ds > buy_source.ds - INTERVAL 7 day + v.user_id = buy_source.user_id AND v.ds <= buy_source.ds AND v.ds > {{ render_date_sub("buy_source", "ds", 7, TimeGranularity.DAY) }} ) b GROUP BY b.referrer_id, b.ds diff --git a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_query_data_source__plan0.sql b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_query_data_source__plan0.sql index 59738a3c1a..fbe8658ce3 100644 --- a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_query_data_source__plan0.sql +++ b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_query_data_source__plan0.sql @@ -1,13 +1,13 @@ -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 diff --git a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_table_data_source_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_table_data_source_with_measures__plan0.sql index c755126f21..5849e34eea 100644 --- a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_table_data_source_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_table_data_source_with_measures__plan0.sql @@ -1,29 +1,29 @@ -- Read Elements From Data Source 'id_verifications' SELECT 1 AS identity_verifications - , id_verifications_src_10003.ds - , DATE_TRUNC('week', id_verifications_src_10003.ds) AS ds__week - , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , id_verifications_src_10003.ds_partitioned - , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , id_verifications_src_10003.verification_type - , id_verifications_src_10003.ds AS verification__ds - , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week - , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned - , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week - , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , id_verifications_src_10003.verification_type AS verification__verification_type - , id_verifications_src_10003.verification_id AS verification - , id_verifications_src_10003.user_id AS user - , id_verifications_src_10003.user_id AS verification__user -FROM ***************************.fct_id_verifications id_verifications_src_10003 + , id_verifications_src_10004.ds + , DATE_TRUNC('week', id_verifications_src_10004.ds) AS ds__week + , DATE_TRUNC('month', id_verifications_src_10004.ds) AS ds__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds) AS ds__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds) AS ds__year + , id_verifications_src_10004.ds_partitioned + , DATE_TRUNC('week', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__year + , id_verifications_src_10004.verification_type + , id_verifications_src_10004.ds AS verification__ds + , DATE_TRUNC('week', id_verifications_src_10004.ds) AS verification__ds__week + , DATE_TRUNC('month', id_verifications_src_10004.ds) AS verification__ds__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds) AS verification__ds__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds) AS verification__ds__year + , id_verifications_src_10004.ds_partitioned AS verification__ds_partitioned + , DATE_TRUNC('week', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__week + , DATE_TRUNC('month', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__year + , id_verifications_src_10004.verification_type AS verification__verification_type + , id_verifications_src_10004.verification_id AS verification + , id_verifications_src_10004.user_id AS user + , id_verifications_src_10004.user_id AS verification__user +FROM ***************************.fct_id_verifications id_verifications_src_10004 diff --git a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_table_data_source_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_table_data_source_without_measures__plan0.sql index 75ae7f94bb..99fd2570f1 100644 --- a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_table_data_source_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/DuckDbSqlClient/test_convert_table_data_source_without_measures__plan0.sql @@ -1,16 +1,16 @@ -- Read Elements From Data Source 'users_latest' SELECT - users_latest_src_10008.ds - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year - , users_latest_src_10008.home_state_latest - , users_latest_src_10008.ds AS user__ds - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year - , users_latest_src_10008.home_state_latest AS user__home_state_latest - , users_latest_src_10008.user_id AS user -FROM ***************************.dim_users_latest users_latest_src_10008 + users_latest_src_10009.ds + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds__year + , users_latest_src_10009.home_state_latest + , users_latest_src_10009.ds AS user__ds + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds__year + , users_latest_src_10009.home_state_latest AS user__home_state_latest + , users_latest_src_10009.user_id AS user +FROM ***************************.dim_users_latest users_latest_src_10009 diff --git a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_query_data_source__plan0.sql b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_query_data_source__plan0.sql index 59738a3c1a..fbe8658ce3 100644 --- a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_query_data_source__plan0.sql +++ b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_query_data_source__plan0.sql @@ -1,13 +1,13 @@ -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 diff --git a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_table_data_source_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_table_data_source_with_measures__plan0.sql index c755126f21..5849e34eea 100644 --- a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_table_data_source_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_table_data_source_with_measures__plan0.sql @@ -1,29 +1,29 @@ -- Read Elements From Data Source 'id_verifications' SELECT 1 AS identity_verifications - , id_verifications_src_10003.ds - , DATE_TRUNC('week', id_verifications_src_10003.ds) AS ds__week - , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , id_verifications_src_10003.ds_partitioned - , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , id_verifications_src_10003.verification_type - , id_verifications_src_10003.ds AS verification__ds - , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week - , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned - , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week - , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , id_verifications_src_10003.verification_type AS verification__verification_type - , id_verifications_src_10003.verification_id AS verification - , id_verifications_src_10003.user_id AS user - , id_verifications_src_10003.user_id AS verification__user -FROM ***************************.fct_id_verifications id_verifications_src_10003 + , id_verifications_src_10004.ds + , DATE_TRUNC('week', id_verifications_src_10004.ds) AS ds__week + , DATE_TRUNC('month', id_verifications_src_10004.ds) AS ds__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds) AS ds__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds) AS ds__year + , id_verifications_src_10004.ds_partitioned + , DATE_TRUNC('week', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__year + , id_verifications_src_10004.verification_type + , id_verifications_src_10004.ds AS verification__ds + , DATE_TRUNC('week', id_verifications_src_10004.ds) AS verification__ds__week + , DATE_TRUNC('month', id_verifications_src_10004.ds) AS verification__ds__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds) AS verification__ds__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds) AS verification__ds__year + , id_verifications_src_10004.ds_partitioned AS verification__ds_partitioned + , DATE_TRUNC('week', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__week + , DATE_TRUNC('month', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__year + , id_verifications_src_10004.verification_type AS verification__verification_type + , id_verifications_src_10004.verification_id AS verification + , id_verifications_src_10004.user_id AS user + , id_verifications_src_10004.user_id AS verification__user +FROM ***************************.fct_id_verifications id_verifications_src_10004 diff --git a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_table_data_source_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_table_data_source_without_measures__plan0.sql index 75ae7f94bb..99fd2570f1 100644 --- a/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_table_data_source_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_data_source.py/SqlQueryPlan/PostgresSqlClient/test_convert_table_data_source_without_measures__plan0.sql @@ -1,16 +1,16 @@ -- Read Elements From Data Source 'users_latest' SELECT - users_latest_src_10008.ds - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year - , users_latest_src_10008.home_state_latest - , users_latest_src_10008.ds AS user__ds - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year - , users_latest_src_10008.home_state_latest AS user__home_state_latest - , users_latest_src_10008.user_id AS user -FROM ***************************.dim_users_latest users_latest_src_10008 + users_latest_src_10009.ds + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds__year + , users_latest_src_10009.home_state_latest + , users_latest_src_10009.ds AS user__ds + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds__year + , users_latest_src_10009.home_state_latest AS user__home_state_latest + , users_latest_src_10009.user_id AS user +FROM ***************************.dim_users_latest users_latest_src_10009 diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_data_source__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_data_source__dfp_0.xml index 4cd986a80b..b1f1b6f90f 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_data_source__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_data_source__dfp_0.xml @@ -76,7 +76,7 @@ - + @@ -97,12 +97,12 @@ - + - + @@ -181,7 +181,7 @@ - + @@ -202,12 +202,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric__dfp_0.xml index 3b3e757a1e..cf5b06862e 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric__dfp_0.xml @@ -34,12 +34,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml index 1bd9e1c247..be6e02eee1 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml @@ -85,7 +85,7 @@ - + @@ -106,12 +106,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_expr_metrics_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_expr_metrics_plan__dfp_0.xml index 6e9dc8bee0..b90bba727b 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_expr_metrics_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_expr_metrics_plan__dfp_0.xml @@ -71,7 +71,7 @@ - + @@ -92,12 +92,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_joined_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_joined_plan__dfp_0.xml index dd16ccbe83..30a185266c 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_joined_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_joined_plan__dfp_0.xml @@ -65,7 +65,7 @@ - + @@ -86,12 +86,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_limit_rows_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_limit_rows_plan__dfp_0.xml index 08f83cb682..712ff08b5f 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_limit_rows_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_limit_rows_plan__dfp_0.xml @@ -40,7 +40,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml index d30dda0150..607a404e03 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml @@ -138,7 +138,7 @@ - + @@ -159,12 +159,12 @@ - + - + @@ -199,7 +199,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml index 687f6be502..03b072abe4 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml @@ -88,7 +88,7 @@ - + @@ -121,7 +121,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_data_source_ratio_metrics_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_data_source_ratio_metrics_plan__dfp_0.xml index 189855a8b1..0a7917ce19 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_data_source_ratio_metrics_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_data_source_ratio_metrics_plan__dfp_0.xml @@ -98,7 +98,7 @@ - + @@ -119,12 +119,12 @@ - + - + @@ -187,12 +187,12 @@ - + - + @@ -213,12 +213,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml index adb619ed0a..81d789a170 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml @@ -71,12 +71,12 @@ - + - + @@ -124,7 +124,7 @@ - + @@ -227,7 +227,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multiple_metrics_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multiple_metrics_plan__dfp_0.xml index 57f1c977da..3cbd71f7e6 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multiple_metrics_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multiple_metrics_plan__dfp_0.xml @@ -43,7 +43,7 @@ - + @@ -87,7 +87,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_order_by_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_order_by_plan__dfp_0.xml index 63b5246ede..d48899f3a4 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_order_by_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_order_by_plan__dfp_0.xml @@ -62,7 +62,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_simple_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_simple_plan__dfp_0.xml index 6d8ca8f2be..86dde22d5a 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_simple_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_simple_plan__dfp_0.xml @@ -33,7 +33,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_data_source_ratio_metrics_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_data_source_ratio_metrics_plan__dfp_0.xml index 128f9f4baa..6d7679c686 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_data_source_ratio_metrics_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_data_source_ratio_metrics_plan__dfp_0.xml @@ -79,7 +79,7 @@ - + @@ -100,12 +100,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan__dfp_0.xml index 2bf29f5ff5..14a3d4bd96 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan__dfp_0.xml @@ -91,7 +91,7 @@ - + @@ -112,12 +112,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml index d66c8bfa30..67211e0cfa 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml @@ -64,7 +64,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_with_common_linkable_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_with_common_linkable_plan__dfp_0.xml index ee06a7f90f..e2c6d171bc 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_with_common_linkable_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_with_common_linkable_plan__dfp_0.xml @@ -76,7 +76,7 @@ - + @@ -97,12 +97,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDbSqlClient/test_joined_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDbSqlClient/test_joined_plan__ep_0.xml index aff9172522..3923df0fe8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDbSqlClient/test_joined_plan__ep_0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDbSqlClient/test_joined_plan__ep_0.xml @@ -10,7 +10,7 @@ - + @@ -27,11 +27,11 @@ - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDbSqlClient/test_multihop_joined_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDbSqlClient/test_multihop_joined_plan__ep_0.xml index 0e0abc3109..70a44e1520 100644 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDbSqlClient/test_multihop_joined_plan__ep_0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDbSqlClient/test_multihop_joined_plan__ep_0.xml @@ -10,31 +10,31 @@ - - + + - - - - + + + + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/PostgresSqlClient/test_joined_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/PostgresSqlClient/test_joined_plan__ep_0.xml index aff9172522..3923df0fe8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/PostgresSqlClient/test_joined_plan__ep_0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/PostgresSqlClient/test_joined_plan__ep_0.xml @@ -10,7 +10,7 @@ - + @@ -27,11 +27,11 @@ - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/PostgresSqlClient/test_multihop_joined_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/PostgresSqlClient/test_multihop_joined_plan__ep_0.xml index 0e0abc3109..70a44e1520 100644 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/PostgresSqlClient/test_multihop_joined_plan__ep_0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/PostgresSqlClient/test_multihop_joined_plan__ep_0.xml @@ -10,31 +10,31 @@ - - + + - - - - + + + + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_compute_metrics_node_simple_expr__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_compute_metrics_node_simple_expr__plan0.xml index 10d9d38318..d6140b63c6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_compute_metrics_node_simple_expr__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_compute_metrics_node_simple_expr__plan0.xml @@ -64,7 +64,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier__plan0.sql index 19c7d6a3ca..91cac67684 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier__plan0.sql @@ -46,24 +46,24 @@ FROM ( -- Read Elements From Data Source 'messages_source' SELECT 1 AS messages - , messages_source_src_10015.ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS ds__year - , messages_source_src_10015.team_id - , messages_source_src_10015.ds AS user_id__ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS user_id__ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS user_id__ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS user_id__ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS user_id__ds__year - , messages_source_src_10015.team_id AS user_id__team_id - , messages_source_src_10015.user_id - , messages_source_src_10015.team_id AS user_team___team_id - , messages_source_src_10015.user_id AS user_team___user_id - , messages_source_src_10015.team_id AS user_id__user_team___team_id - , messages_source_src_10015.user_id AS user_id__user_team___user_id - FROM ***************************.fct_messages messages_source_src_10015 + , messages_source_src_10017.ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS ds__year + , messages_source_src_10017.team_id + , messages_source_src_10017.ds AS user_id__ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS user_id__ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS user_id__ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS user_id__ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS user_id__ds__year + , messages_source_src_10017.team_id AS user_id__team_id + , messages_source_src_10017.user_id + , messages_source_src_10017.team_id AS user_team___team_id + , messages_source_src_10017.user_id AS user_team___user_id + , messages_source_src_10017.team_id AS user_id__user_team___team_id + , messages_source_src_10017.user_id AS user_id__user_team___user_id + FROM ***************************.fct_messages messages_source_src_10017 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier__plan0_optimized.sql index 5874a6ce5c..5d6458aa19 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( team_id AS user_team___team_id , user_id AS user_team___user_id , 1 AS messages - FROM ***************************.fct_messages messages_source_src_10015 + FROM ***************************.fct_messages messages_source_src_10017 ) subq_6 GROUP BY user_team___team_id diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_join__plan0.sql index f0944ea181..db32ddab0d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_join__plan0.sql @@ -63,24 +63,24 @@ FROM ( -- Read Elements From Data Source 'messages_source' SELECT 1 AS messages - , messages_source_src_10015.ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS ds__year - , messages_source_src_10015.team_id - , messages_source_src_10015.ds AS user_id__ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS user_id__ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS user_id__ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS user_id__ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS user_id__ds__year - , messages_source_src_10015.team_id AS user_id__team_id - , messages_source_src_10015.user_id - , messages_source_src_10015.team_id AS user_team___team_id - , messages_source_src_10015.user_id AS user_team___user_id - , messages_source_src_10015.team_id AS user_id__user_team___team_id - , messages_source_src_10015.user_id AS user_id__user_team___user_id - FROM ***************************.fct_messages messages_source_src_10015 + , messages_source_src_10017.ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS ds__year + , messages_source_src_10017.team_id + , messages_source_src_10017.ds AS user_id__ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS user_id__ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS user_id__ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS user_id__ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS user_id__ds__year + , messages_source_src_10017.team_id AS user_id__team_id + , messages_source_src_10017.user_id + , messages_source_src_10017.team_id AS user_team___team_id + , messages_source_src_10017.user_id AS user_team___user_id + , messages_source_src_10017.team_id AS user_id__user_team___team_id + , messages_source_src_10017.user_id AS user_id__user_team___user_id + FROM ***************************.fct_messages messages_source_src_10017 ) subq_0 ) subq_1 ) subq_2 @@ -94,50 +94,50 @@ FROM ( FROM ( -- Read Elements From Data Source 'users_source' SELECT - users_source_src_10017.created_at AS ds - , DATE_TRUNC('week', users_source_src_10017.created_at) AS ds__week - , DATE_TRUNC('month', users_source_src_10017.created_at) AS ds__month - , DATE_TRUNC('quarter', users_source_src_10017.created_at) AS ds__quarter - , DATE_TRUNC('year', users_source_src_10017.created_at) AS ds__year - , users_source_src_10017.team_id - , users_source_src_10017.country - , users_source_src_10017.created_at AS user_id__ds - , DATE_TRUNC('week', users_source_src_10017.created_at) AS user_id__ds__week - , DATE_TRUNC('month', users_source_src_10017.created_at) AS user_id__ds__month - , DATE_TRUNC('quarter', users_source_src_10017.created_at) AS user_id__ds__quarter - , DATE_TRUNC('year', users_source_src_10017.created_at) AS user_id__ds__year - , users_source_src_10017.team_id AS user_id__team_id - , users_source_src_10017.country AS user_id__country - , users_source_src_10017.created_at AS user_composite_ident_2__ds - , DATE_TRUNC('week', users_source_src_10017.created_at) AS user_composite_ident_2__ds__week - , DATE_TRUNC('month', users_source_src_10017.created_at) AS user_composite_ident_2__ds__month - , DATE_TRUNC('quarter', users_source_src_10017.created_at) AS user_composite_ident_2__ds__quarter - , DATE_TRUNC('year', users_source_src_10017.created_at) AS user_composite_ident_2__ds__year - , users_source_src_10017.team_id AS user_composite_ident_2__team_id - , users_source_src_10017.country AS user_composite_ident_2__country - , users_source_src_10017.created_at AS user_team__ds - , DATE_TRUNC('week', users_source_src_10017.created_at) AS user_team__ds__week - , DATE_TRUNC('month', users_source_src_10017.created_at) AS user_team__ds__month - , DATE_TRUNC('quarter', users_source_src_10017.created_at) AS user_team__ds__quarter - , DATE_TRUNC('year', users_source_src_10017.created_at) AS user_team__ds__year - , users_source_src_10017.team_id AS user_team__team_id - , users_source_src_10017.country AS user_team__country - , users_source_src_10017.id AS user_id - , users_source_src_10017.ident_2 AS user_composite_ident_2___ident_2 - , users_source_src_10017.id AS user_composite_ident_2___user_id - , users_source_src_10017.team_id AS user_team___team_id - , users_source_src_10017.id AS user_team___user_id - , users_source_src_10017.ident_2 AS user_id__user_composite_ident_2___ident_2 - , users_source_src_10017.id AS user_id__user_composite_ident_2___user_id - , users_source_src_10017.team_id AS user_id__user_team___team_id - , users_source_src_10017.id AS user_id__user_team___user_id - , users_source_src_10017.id AS user_composite_ident_2__user_id - , users_source_src_10017.team_id AS user_composite_ident_2__user_team___team_id - , users_source_src_10017.id AS user_composite_ident_2__user_team___user_id - , users_source_src_10017.id AS user_team__user_id - , users_source_src_10017.ident_2 AS user_team__user_composite_ident_2___ident_2 - , users_source_src_10017.id AS user_team__user_composite_ident_2___user_id - FROM ***************************.fct_users users_source_src_10017 + users_source_src_10019.created_at AS ds + , DATE_TRUNC('week', users_source_src_10019.created_at) AS ds__week + , DATE_TRUNC('month', users_source_src_10019.created_at) AS ds__month + , DATE_TRUNC('quarter', users_source_src_10019.created_at) AS ds__quarter + , DATE_TRUNC('year', users_source_src_10019.created_at) AS ds__year + , users_source_src_10019.team_id + , users_source_src_10019.country + , users_source_src_10019.created_at AS user_id__ds + , DATE_TRUNC('week', users_source_src_10019.created_at) AS user_id__ds__week + , DATE_TRUNC('month', users_source_src_10019.created_at) AS user_id__ds__month + , DATE_TRUNC('quarter', users_source_src_10019.created_at) AS user_id__ds__quarter + , DATE_TRUNC('year', users_source_src_10019.created_at) AS user_id__ds__year + , users_source_src_10019.team_id AS user_id__team_id + , users_source_src_10019.country AS user_id__country + , users_source_src_10019.created_at AS user_composite_ident_2__ds + , DATE_TRUNC('week', users_source_src_10019.created_at) AS user_composite_ident_2__ds__week + , DATE_TRUNC('month', users_source_src_10019.created_at) AS user_composite_ident_2__ds__month + , DATE_TRUNC('quarter', users_source_src_10019.created_at) AS user_composite_ident_2__ds__quarter + , DATE_TRUNC('year', users_source_src_10019.created_at) AS user_composite_ident_2__ds__year + , users_source_src_10019.team_id AS user_composite_ident_2__team_id + , users_source_src_10019.country AS user_composite_ident_2__country + , users_source_src_10019.created_at AS user_team__ds + , DATE_TRUNC('week', users_source_src_10019.created_at) AS user_team__ds__week + , DATE_TRUNC('month', users_source_src_10019.created_at) AS user_team__ds__month + , DATE_TRUNC('quarter', users_source_src_10019.created_at) AS user_team__ds__quarter + , DATE_TRUNC('year', users_source_src_10019.created_at) AS user_team__ds__year + , users_source_src_10019.team_id AS user_team__team_id + , users_source_src_10019.country AS user_team__country + , users_source_src_10019.id AS user_id + , users_source_src_10019.ident_2 AS user_composite_ident_2___ident_2 + , users_source_src_10019.id AS user_composite_ident_2___user_id + , users_source_src_10019.team_id AS user_team___team_id + , users_source_src_10019.id AS user_team___user_id + , users_source_src_10019.ident_2 AS user_id__user_composite_ident_2___ident_2 + , users_source_src_10019.id AS user_id__user_composite_ident_2___user_id + , users_source_src_10019.team_id AS user_id__user_team___team_id + , users_source_src_10019.id AS user_id__user_team___user_id + , users_source_src_10019.id AS user_composite_ident_2__user_id + , users_source_src_10019.team_id AS user_composite_ident_2__user_team___team_id + , users_source_src_10019.id AS user_composite_ident_2__user_team___user_id + , users_source_src_10019.id AS user_team__user_id + , users_source_src_10019.ident_2 AS user_team__user_composite_ident_2___ident_2 + , users_source_src_10019.id AS user_team__user_composite_ident_2___user_id + FROM ***************************.fct_users users_source_src_10019 ) subq_3 ) subq_4 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_join__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_join__plan0_optimized.sql index 197f4ee9ff..d1a7f469af 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_join__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_join__plan0_optimized.sql @@ -6,7 +6,7 @@ SELECT subq_10.user_team___team_id AS user_team___team_id , subq_10.user_team___user_id AS user_team___user_id - , users_source_src_10017.country AS user_team__country + , users_source_src_10019.country AS user_team__country , SUM(subq_10.messages) AS messages FROM ( -- Read Elements From Data Source 'messages_source' @@ -17,17 +17,17 @@ FROM ( team_id AS user_team___team_id , user_id AS user_team___user_id , 1 AS messages - FROM ***************************.fct_messages messages_source_src_10015 + FROM ***************************.fct_messages messages_source_src_10017 ) subq_10 LEFT OUTER JOIN - ***************************.fct_users users_source_src_10017 + ***************************.fct_users users_source_src_10019 ON ( - subq_10.user_team___team_id = users_source_src_10017.team_id + subq_10.user_team___team_id = users_source_src_10019.team_id ) AND ( - subq_10.user_team___user_id = users_source_src_10017.id + subq_10.user_team___user_id = users_source_src_10019.id ) GROUP BY subq_10.user_team___team_id , subq_10.user_team___user_id - , users_source_src_10017.country + , users_source_src_10019.country diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_order_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_order_by__plan0.sql index 729cf82253..a9238e4659 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_order_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_order_by__plan0.sql @@ -52,24 +52,24 @@ FROM ( -- Read Elements From Data Source 'messages_source' SELECT 1 AS messages - , messages_source_src_10015.ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS ds__year - , messages_source_src_10015.team_id - , messages_source_src_10015.ds AS user_id__ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS user_id__ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS user_id__ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS user_id__ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS user_id__ds__year - , messages_source_src_10015.team_id AS user_id__team_id - , messages_source_src_10015.user_id - , messages_source_src_10015.team_id AS user_team___team_id - , messages_source_src_10015.user_id AS user_team___user_id - , messages_source_src_10015.team_id AS user_id__user_team___team_id - , messages_source_src_10015.user_id AS user_id__user_team___user_id - FROM ***************************.fct_messages messages_source_src_10015 + , messages_source_src_10017.ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS ds__year + , messages_source_src_10017.team_id + , messages_source_src_10017.ds AS user_id__ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS user_id__ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS user_id__ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS user_id__ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS user_id__ds__year + , messages_source_src_10017.team_id AS user_id__team_id + , messages_source_src_10017.user_id + , messages_source_src_10017.team_id AS user_team___team_id + , messages_source_src_10017.user_id AS user_team___user_id + , messages_source_src_10017.team_id AS user_id__user_team___team_id + , messages_source_src_10017.user_id AS user_id__user_team___user_id + FROM ***************************.fct_messages messages_source_src_10017 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_order_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_order_by__plan0_optimized.sql index 0d8ba1d7e2..2704ce4673 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_order_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_composite_identifier_with_order_by__plan0_optimized.sql @@ -14,7 +14,7 @@ FROM ( team_id AS user_team___team_id , user_id AS user_team___user_id , 1 AS messages - FROM ***************************.fct_messages messages_source_src_10015 + FROM ***************************.fct_messages messages_source_src_10017 ) subq_7 GROUP BY user_team___team_id diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node__plan0.sql index 14643e6eb2..a80874cda0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node__plan0.sql @@ -93,38 +93,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_2 ) subq_3 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node__plan0_optimized.sql index c92dc4aec4..4ded6af2e2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node__plan0_optimized.sql @@ -3,7 +3,7 @@ -- Compute Metrics via Expressions SELECT subq_7.listing AS listing - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_7.bookings) AS bookings FROM ( -- Read Elements From Data Source 'bookings_source' @@ -18,9 +18,9 @@ FROM ( ) bookings_source_src_10001 ) subq_7 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_7.listing = listings_latest_src_10004.listing_id + subq_7.listing = listings_latest_src_10005.listing_id GROUP BY subq_7.listing - , listings_latest_src_10004.country + , listings_latest_src_10005.country diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.sql index 24b4c61196..9f4a434e1c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.sql @@ -218,38 +218,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_3 ) subq_4 ) subq_5 @@ -326,35 +326,35 @@ FROM ( -- Read Elements From Data Source 'views_source' SELECT 1 AS views - , views_source_src_10009.ds - , DATE_TRUNC('week', views_source_src_10009.ds) AS ds__week - , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month - , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter - , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year - , views_source_src_10009.ds_partitioned - , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year - , views_source_src_10009.ds AS create_a_cycle_in_the_join_graph__ds - , DATE_TRUNC('week', views_source_src_10009.ds) AS create_a_cycle_in_the_join_graph__ds__week - , DATE_TRUNC('month', views_source_src_10009.ds) AS create_a_cycle_in_the_join_graph__ds__month - , DATE_TRUNC('quarter', views_source_src_10009.ds) AS create_a_cycle_in_the_join_graph__ds__quarter - , DATE_TRUNC('year', views_source_src_10009.ds) AS create_a_cycle_in_the_join_graph__ds__year - , views_source_src_10009.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , views_source_src_10009.listing_id AS listing - , views_source_src_10009.user_id AS user - , views_source_src_10009.user_id AS create_a_cycle_in_the_join_graph - , views_source_src_10009.listing_id AS create_a_cycle_in_the_join_graph__listing - , views_source_src_10009.user_id AS create_a_cycle_in_the_join_graph__user + , views_source_src_10010.ds + , DATE_TRUNC('week', views_source_src_10010.ds) AS ds__week + , DATE_TRUNC('month', views_source_src_10010.ds) AS ds__month + , DATE_TRUNC('quarter', views_source_src_10010.ds) AS ds__quarter + , DATE_TRUNC('year', views_source_src_10010.ds) AS ds__year + , views_source_src_10010.ds_partitioned + , DATE_TRUNC('week', views_source_src_10010.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', views_source_src_10010.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', views_source_src_10010.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', views_source_src_10010.ds_partitioned) AS ds_partitioned__year + , views_source_src_10010.ds AS create_a_cycle_in_the_join_graph__ds + , DATE_TRUNC('week', views_source_src_10010.ds) AS create_a_cycle_in_the_join_graph__ds__week + , DATE_TRUNC('month', views_source_src_10010.ds) AS create_a_cycle_in_the_join_graph__ds__month + , DATE_TRUNC('quarter', views_source_src_10010.ds) AS create_a_cycle_in_the_join_graph__ds__quarter + , DATE_TRUNC('year', views_source_src_10010.ds) AS create_a_cycle_in_the_join_graph__ds__year + , views_source_src_10010.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned + , DATE_TRUNC('week', views_source_src_10010.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__week + , DATE_TRUNC('month', views_source_src_10010.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__month + , DATE_TRUNC('quarter', views_source_src_10010.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter + , DATE_TRUNC('year', views_source_src_10010.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__year + , views_source_src_10010.listing_id AS listing + , views_source_src_10010.user_id AS user + , views_source_src_10010.user_id AS create_a_cycle_in_the_join_graph + , views_source_src_10010.listing_id AS create_a_cycle_in_the_join_graph__listing + , views_source_src_10010.user_id AS create_a_cycle_in_the_join_graph__user FROM ( -- User Defined SQL Query SELECT user_id, listing_id, ds, ds_partitioned FROM ***************************.fct_views - ) views_source_src_10009 + ) views_source_src_10010 ) subq_9 ) subq_10 ) subq_11 @@ -408,38 +408,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_12 ) subq_13 ) subq_14 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0_optimized.sql index 53f8e603a3..6d06121457 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( -- Aggregate Measures SELECT subq_22.ds AS ds - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_22.bookings) AS bookings FROM ( -- Read Elements From Data Source 'bookings_source' @@ -30,12 +30,12 @@ FROM ( ) bookings_source_src_10001 ) subq_22 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_22.listing = listings_latest_src_10004.listing_id + subq_22.listing = listings_latest_src_10005.listing_id GROUP BY subq_22.ds - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_28 INNER JOIN ( -- Join Standard Outputs @@ -44,7 +44,7 @@ INNER JOIN ( -- Aggregate Measures SELECT subq_31.ds AS ds - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_31.views) AS views FROM ( -- Read Elements From Data Source 'views_source' @@ -58,15 +58,15 @@ INNER JOIN ( FROM ( -- User Defined SQL Query SELECT user_id, listing_id, ds, ds_partitioned FROM ***************************.fct_views - ) views_source_src_10009 + ) views_source_src_10010 ) subq_31 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_31.listing = listings_latest_src_10004.listing_id + subq_31.listing = listings_latest_src_10005.listing_id GROUP BY subq_31.ds - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_37 ON ( diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0.sql index c1c58e83ae..97ad028de0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0.sql @@ -96,38 +96,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_2 ) subq_3 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0_optimized.sql index d4ff05fa1c..f2dded656b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Aggregate Measures SELECT subq_7.listing AS listing - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_7.bookings) AS bookings , COUNT(DISTINCT subq_7.bookers) AS bookers FROM ( @@ -25,10 +25,10 @@ FROM ( ) bookings_source_src_10001 ) subq_7 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_7.listing = listings_latest_src_10004.listing_id + subq_7.listing = listings_latest_src_10005.listing_id GROUP BY subq_7.listing - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_11 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_simple_expr__plan0.sql index af06dc32a0..77fdc2484f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_simple_expr__plan0.sql @@ -93,38 +93,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_2 ) subq_3 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_simple_expr__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_simple_expr__plan0_optimized.sql index cbc93f25c5..be8c4f681b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_simple_expr__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_compute_metrics_node_simple_expr__plan0_optimized.sql @@ -8,17 +8,17 @@ FROM ( -- Aggregate Measures SELECT bookings_source_src_10001.listing_id AS listing - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(bookings_source_src_10001.booking_value) AS booking_value FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_bookings ) bookings_source_src_10001 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - bookings_source_src_10001.listing_id = listings_latest_src_10004.listing_id + bookings_source_src_10001.listing_id = listings_latest_src_10005.listing_id GROUP BY bookings_source_src_10001.listing_id - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_11 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric__plan0.sql index c9adb7c74a..645ab1ef7a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric__plan0.sql @@ -31,17 +31,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 ) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric__plan0_optimized.sql index 6ce7eb9f16..9eb18c7706 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric__plan0_optimized.sql @@ -10,6 +10,6 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_grain_to_date__plan0.sql index 9c5aac9f71..d56ca5db59 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_grain_to_date__plan0.sql @@ -31,17 +31,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 ) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_grain_to_date__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_grain_to_date__plan0_optimized.sql index 70a814685d..73d6f53157 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_grain_to_date__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_grain_to_date__plan0_optimized.sql @@ -10,6 +10,6 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_ds__plan0.sql index 8a8b927c31..1b8e6aadb0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_ds__plan0.sql @@ -28,17 +28,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 ) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_ds__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_ds__plan0_optimized.sql index a852f552b0..9e3110067e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_ds__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_ds__plan0_optimized.sql @@ -9,4 +9,4 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window__plan0.sql index e460bce945..87e138974d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window__plan0.sql @@ -31,17 +31,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 ) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window__plan0_optimized.sql index 870ee251a6..b1dd9cac86 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window__plan0_optimized.sql @@ -10,6 +10,6 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 72136f3a44..7cc39c259f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -46,17 +46,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 WHERE subq_1.metric_time BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql index 53bd8842bd..7ca3598979 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql @@ -11,7 +11,7 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 WHERE created_at BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_with_time_constraint__plan0.sql index fa6672724b..8e7bbd8c93 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_with_time_constraint__plan0.sql @@ -46,17 +46,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 WHERE subq_1.metric_time BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_with_time_constraint__plan0_optimized.sql index 5e6e5237f3..3769f1c4fe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_cumulative_metric_with_time_constraint__plan0_optimized.sql @@ -11,7 +11,7 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 WHERE created_at BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_distinct_values__plan0.sql index 5942f21287..f4dec3f7ad 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_distinct_values__plan0.sql @@ -207,38 +207,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_3 ) subq_4 ) subq_5 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_distinct_values__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_distinct_values__plan0_optimized.sql index c479c10486..c2ffa7198c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_distinct_values__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_distinct_values__plan0_optimized.sql @@ -7,16 +7,16 @@ -- ['listing__country_latest'] -- Order By ['listing__country_latest'] Limit 100 SELECT - listings_latest_src_10004.country AS listing__country_latest + listings_latest_src_10005.country AS listing__country_latest FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_bookings ) bookings_source_src_10001 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - bookings_source_src_10001.listing_id = listings_latest_src_10004.listing_id + bookings_source_src_10001.listing_id = listings_latest_src_10005.listing_id GROUP BY - listings_latest_src_10004.country + listings_latest_src_10005.country ORDER BY listing__country_latest LIMIT 100 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_filter_with_where_constraint_on_join_dim__plan0.sql index 7300f23440..2d2c5426b2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -213,38 +213,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_3 ) subq_4 ) subq_5 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql index c5a1407424..40d9edad54 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql @@ -12,7 +12,7 @@ FROM ( -- ['bookings', 'is_instant', 'listing__country_latest'] SELECT subq_13.is_instant AS is_instant - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , subq_13.bookings AS bookings FROM ( -- Read Elements From Data Source 'bookings_source' @@ -29,9 +29,9 @@ FROM ( ) bookings_source_src_10001 ) subq_13 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_13.listing = listings_latest_src_10004.listing_id + subq_13.listing = listings_latest_src_10005.listing_id ) subq_18 WHERE listing__country_latest = 'us' GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_conversion_events_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_conversion_events_node__plan0.sql new file mode 100644 index 0000000000..a36b5a2394 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_conversion_events_node__plan0.sql @@ -0,0 +1,83 @@ +-- Find conversions for IdentifierSpec(element_name='user', identifier_links=()) within the range of 7 day +SELECT + subq_3.ds + , subq_3.ds__week + , subq_3.ds__month + , subq_3.ds__quarter + , subq_3.ds__year + , subq_3.user + , subq_3.referrer_id + , subq_3.buys + , subq_3.visits + , subq_3.visitors +FROM ( + -- Dedupe the fanout on (MetadataSpec(element_name='mf_internal_uuid'),) in the conversion data set + SELECT DISTINCT + first_value(subq_0.visits) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS visits + , first_value(subq_0.visitors) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS visitors + , first_value(subq_0.referrer_id) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS referrer_id + , first_value(subq_0.ds) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS ds + , first_value(subq_0.ds__week) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS ds__week + , first_value(subq_0.ds__month) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS ds__month + , first_value(subq_0.ds__quarter) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS ds__quarter + , first_value(subq_0.ds__year) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS ds__year + , first_value(subq_0.user) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS user + , subq_2.mf_internal_uuid AS mf_internal_uuid + , subq_2.buys AS buys + FROM ( + -- Read Elements From Data Source 'visits_source' + SELECT + 1 AS visits + , visits_source_src_10011.user_id AS visitors + , visits_source_src_10011.ds + , DATE_TRUNC('week', visits_source_src_10011.ds) AS ds__week + , DATE_TRUNC('month', visits_source_src_10011.ds) AS ds__month + , DATE_TRUNC('quarter', visits_source_src_10011.ds) AS ds__quarter + , DATE_TRUNC('year', visits_source_src_10011.ds) AS ds__year + , visits_source_src_10011.referrer_id + , visits_source_src_10011.user_id AS user + FROM ( + -- User Defined SQL Query + SELECT * FROM ***************************.fct_visits + ) visits_source_src_10011 + ) subq_0 + INNER JOIN ( + -- Add column with generated UUID + SELECT + subq_1.ds + , subq_1.ds__week + , subq_1.ds__month + , subq_1.ds__quarter + , subq_1.ds__year + , subq_1.user + , subq_1.buys + , subq_1.buyers + , GEN_RANDOM_UUID() AS mf_internal_uuid + FROM ( + -- Read Elements From Data Source 'buys_source' + SELECT + 1 AS buys + , buys_source_src_10002.user_id AS buyers + , buys_source_src_10002.ds + , DATE_TRUNC('week', buys_source_src_10002.ds) AS ds__week + , DATE_TRUNC('month', buys_source_src_10002.ds) AS ds__month + , DATE_TRUNC('quarter', buys_source_src_10002.ds) AS ds__quarter + , DATE_TRUNC('year', buys_source_src_10002.ds) AS ds__year + , buys_source_src_10002.user_id AS user + FROM ( + -- User Defined SQL Query + SELECT * FROM ***************************.fct_buys + ) buys_source_src_10002 + ) subq_1 + ) subq_2 + ON + ( + subq_0.user = subq_2.user + ) AND ( + ( + subq_0.ds <= subq_2.ds + ) AND ( + subq_0.ds > subq_2.ds - INTERVAL 7 day + ) + ) +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_conversion_events_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_conversion_events_node__plan0_optimized.sql new file mode 100644 index 0000000000..28f43c0cc4 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_conversion_events_node__plan0_optimized.sql @@ -0,0 +1,67 @@ +-- Find conversions for IdentifierSpec(element_name='user', identifier_links=()) within the range of 7 day +SELECT + ds + , ds__week + , ds__month + , ds__quarter + , ds__year + , subq_7.user + , referrer_id + , buys + , visits + , visitors +FROM ( + -- Dedupe the fanout on (MetadataSpec(element_name='mf_internal_uuid'),) in the conversion data set + SELECT DISTINCT + first_value(subq_4.visits) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS visits + , first_value(subq_4.visitors) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS visitors + , first_value(subq_4.referrer_id) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS referrer_id + , first_value(subq_4.ds) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS ds + , first_value(subq_4.ds__week) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS ds__week + , first_value(subq_4.ds__month) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS ds__month + , first_value(subq_4.ds__quarter) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS ds__quarter + , first_value(subq_4.ds__year) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS ds__year + , first_value(subq_4.user) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS user + , subq_6.mf_internal_uuid AS mf_internal_uuid + , subq_6.buys AS buys + FROM ( + -- Read Elements From Data Source 'visits_source' + SELECT + 1 AS visits + , user_id AS visitors + , ds + , DATE_TRUNC('week', ds) AS ds__week + , DATE_TRUNC('month', ds) AS ds__month + , DATE_TRUNC('quarter', ds) AS ds__quarter + , DATE_TRUNC('year', ds) AS ds__year + , referrer_id + , user_id AS user + FROM ( + -- User Defined SQL Query + SELECT * FROM ***************************.fct_visits + ) visits_source_src_10011 + ) subq_4 + INNER JOIN ( + -- Read Elements From Data Source 'buys_source' + -- Add column with generated UUID + SELECT + ds + , user_id AS user + , 1 AS buys + , GEN_RANDOM_UUID() AS mf_internal_uuid + FROM ( + -- User Defined SQL Query + SELECT * FROM ***************************.fct_buys + ) buys_source_src_10002 + ) subq_6 + ON + ( + subq_4.user = subq_6.user + ) AND ( + ( + subq_4.ds <= subq_6.ds + ) AND ( + subq_4.ds > subq_6.ds - INTERVAL 7 day + ) + ) +) subq_7 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_to_scd_dimension__plan0.sql index b2b573ee8e..e4f5ea6fc5 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_to_scd_dimension__plan0.sql @@ -80,31 +80,31 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10018.booking_value - , bookings_source_src_10018.guest_id AS bookers - , bookings_source_src_10018.booking_value AS average_booking_value - , bookings_source_src_10018.booking_value AS booking_payments - , bookings_source_src_10018.is_instant - , bookings_source_src_10018.ds - , DATE_TRUNC('week', bookings_source_src_10018.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10018.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds) AS ds__year - , bookings_source_src_10018.ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__year - , bookings_source_src_10018.booking_paid_at - , DATE_TRUNC('week', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__week - , DATE_TRUNC('month', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__year - , bookings_source_src_10018.listing_id AS listing - , bookings_source_src_10018.guest_id AS guest - , bookings_source_src_10018.host_id AS host - , bookings_source_src_10018.guest_id AS user - FROM ***************************.fct_bookings bookings_source_src_10018 + , bookings_source_src_10020.booking_value + , bookings_source_src_10020.guest_id AS bookers + , bookings_source_src_10020.booking_value AS average_booking_value + , bookings_source_src_10020.booking_value AS booking_payments + , bookings_source_src_10020.is_instant + , bookings_source_src_10020.ds + , DATE_TRUNC('week', bookings_source_src_10020.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10020.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds) AS ds__year + , bookings_source_src_10020.ds_partitioned + , DATE_TRUNC('week', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__year + , bookings_source_src_10020.booking_paid_at + , DATE_TRUNC('week', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__week + , DATE_TRUNC('month', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__year + , bookings_source_src_10020.listing_id AS listing + , bookings_source_src_10020.guest_id AS guest + , bookings_source_src_10020.host_id AS host + , bookings_source_src_10020.guest_id AS user + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_0 ) subq_1 ) subq_2 @@ -119,36 +119,36 @@ FROM ( FROM ( -- Read Elements From Data Source 'listings' SELECT - listings_src_10020.active_from AS window_start - , DATE_TRUNC('week', listings_src_10020.active_from) AS window_start__week - , DATE_TRUNC('month', listings_src_10020.active_from) AS window_start__month - , DATE_TRUNC('quarter', listings_src_10020.active_from) AS window_start__quarter - , DATE_TRUNC('year', listings_src_10020.active_from) AS window_start__year - , listings_src_10020.active_to AS window_end - , DATE_TRUNC('week', listings_src_10020.active_to) AS window_end__week - , DATE_TRUNC('month', listings_src_10020.active_to) AS window_end__month - , DATE_TRUNC('quarter', listings_src_10020.active_to) AS window_end__quarter - , DATE_TRUNC('year', listings_src_10020.active_to) AS window_end__year - , listings_src_10020.country - , listings_src_10020.is_lux - , listings_src_10020.capacity - , listings_src_10020.active_from AS listing__window_start - , DATE_TRUNC('week', listings_src_10020.active_from) AS listing__window_start__week - , DATE_TRUNC('month', listings_src_10020.active_from) AS listing__window_start__month - , DATE_TRUNC('quarter', listings_src_10020.active_from) AS listing__window_start__quarter - , DATE_TRUNC('year', listings_src_10020.active_from) AS listing__window_start__year - , listings_src_10020.active_to AS listing__window_end - , DATE_TRUNC('week', listings_src_10020.active_to) AS listing__window_end__week - , DATE_TRUNC('month', listings_src_10020.active_to) AS listing__window_end__month - , DATE_TRUNC('quarter', listings_src_10020.active_to) AS listing__window_end__quarter - , DATE_TRUNC('year', listings_src_10020.active_to) AS listing__window_end__year - , listings_src_10020.country AS listing__country - , listings_src_10020.is_lux AS listing__is_lux - , listings_src_10020.capacity AS listing__capacity - , listings_src_10020.listing_id AS listing - , listings_src_10020.user_id AS user - , listings_src_10020.user_id AS listing__user - FROM ***************************.dim_listings listings_src_10020 + listings_src_10022.active_from AS window_start + , DATE_TRUNC('week', listings_src_10022.active_from) AS window_start__week + , DATE_TRUNC('month', listings_src_10022.active_from) AS window_start__month + , DATE_TRUNC('quarter', listings_src_10022.active_from) AS window_start__quarter + , DATE_TRUNC('year', listings_src_10022.active_from) AS window_start__year + , listings_src_10022.active_to AS window_end + , DATE_TRUNC('week', listings_src_10022.active_to) AS window_end__week + , DATE_TRUNC('month', listings_src_10022.active_to) AS window_end__month + , DATE_TRUNC('quarter', listings_src_10022.active_to) AS window_end__quarter + , DATE_TRUNC('year', listings_src_10022.active_to) AS window_end__year + , listings_src_10022.country + , listings_src_10022.is_lux + , listings_src_10022.capacity + , listings_src_10022.active_from AS listing__window_start + , DATE_TRUNC('week', listings_src_10022.active_from) AS listing__window_start__week + , DATE_TRUNC('month', listings_src_10022.active_from) AS listing__window_start__month + , DATE_TRUNC('quarter', listings_src_10022.active_from) AS listing__window_start__quarter + , DATE_TRUNC('year', listings_src_10022.active_from) AS listing__window_start__year + , listings_src_10022.active_to AS listing__window_end + , DATE_TRUNC('week', listings_src_10022.active_to) AS listing__window_end__week + , DATE_TRUNC('month', listings_src_10022.active_to) AS listing__window_end__month + , DATE_TRUNC('quarter', listings_src_10022.active_to) AS listing__window_end__quarter + , DATE_TRUNC('year', listings_src_10022.active_to) AS listing__window_end__year + , listings_src_10022.country AS listing__country + , listings_src_10022.is_lux AS listing__is_lux + , listings_src_10022.capacity AS listing__capacity + , listings_src_10022.listing_id AS listing + , listings_src_10022.user_id AS user + , listings_src_10022.user_id AS listing__user + FROM ***************************.dim_listings listings_src_10022 ) subq_3 ) subq_4 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_to_scd_dimension__plan0_optimized.sql index 806ee6523a..fc9c6b0586 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_join_to_scd_dimension__plan0_optimized.sql @@ -12,7 +12,7 @@ FROM ( -- ['bookings', 'listing__capacity', 'metric_time'] SELECT subq_12.metric_time AS metric_time - , listings_src_10020.capacity AS listing__capacity + , listings_src_10022.capacity AS listing__capacity , subq_12.bookings AS bookings FROM ( -- Read Elements From Data Source 'bookings_source' @@ -23,21 +23,21 @@ FROM ( ds AS metric_time , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10018 + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_12 LEFT OUTER JOIN - ***************************.dim_listings listings_src_10020 + ***************************.dim_listings listings_src_10022 ON ( - subq_12.listing = listings_src_10020.listing_id + subq_12.listing = listings_src_10022.listing_id ) AND ( ( - subq_12.metric_time >= listings_src_10020.active_from + subq_12.metric_time >= listings_src_10022.active_from ) AND ( ( - subq_12.metric_time < listings_src_10020.active_to + subq_12.metric_time < listings_src_10022.active_to ) OR ( - listings_src_10020.active_to IS NULL + listings_src_10022.active_to IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0.sql index 2e7ec02d12..7f12ee4a3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0.sql @@ -57,38 +57,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql index 3c0f240434..5182b302e3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql @@ -11,7 +11,7 @@ FROM ( SELECT country AS listing__country_latest , 1 AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_6 GROUP BY listing__country_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_measure_constraint__plan0.sql index 29b5d02967..5d7a250860 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_measure_constraint__plan0.sql @@ -234,38 +234,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_3 ) subq_4 ) subq_5 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_measure_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_measure_constraint__plan0_optimized.sql index b4163117c1..73e0f36a00 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_measure_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_measure_constraint__plan0_optimized.sql @@ -26,7 +26,7 @@ FROM ( -- ['average_booking_value', 'bookings', 'listing__is_lux_latest', 'metric_time'] SELECT subq_19.metric_time AS metric_time - , listings_latest_src_10004.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest , subq_19.bookings AS bookings , subq_19.average_booking_value AS average_booking_value FROM ( @@ -45,9 +45,9 @@ FROM ( ) bookings_source_src_10001 ) subq_19 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_19.listing = listings_latest_src_10004.listing_id + subq_19.listing = listings_latest_src_10005.listing_id ) subq_24 WHERE listing__is_lux_latest GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index e1f3c7febf..910702d9f8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -198,38 +198,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_4 ) subq_5 ) subq_6 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql index 75aca6b344..b0c83b76e4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql @@ -25,5 +25,5 @@ CROSS JOIN ( -- Aggregate Measures SELECT SUM(1) AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_17 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_through_scd_dimension__plan0.sql index de96078445..7a7dcfbc29 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_through_scd_dimension__plan0.sql @@ -70,31 +70,31 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10018.booking_value - , bookings_source_src_10018.guest_id AS bookers - , bookings_source_src_10018.booking_value AS average_booking_value - , bookings_source_src_10018.booking_value AS booking_payments - , bookings_source_src_10018.is_instant - , bookings_source_src_10018.ds - , DATE_TRUNC('week', bookings_source_src_10018.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10018.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds) AS ds__year - , bookings_source_src_10018.ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__year - , bookings_source_src_10018.booking_paid_at - , DATE_TRUNC('week', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__week - , DATE_TRUNC('month', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__year - , bookings_source_src_10018.listing_id AS listing - , bookings_source_src_10018.guest_id AS guest - , bookings_source_src_10018.host_id AS host - , bookings_source_src_10018.guest_id AS user - FROM ***************************.fct_bookings bookings_source_src_10018 + , bookings_source_src_10020.booking_value + , bookings_source_src_10020.guest_id AS bookers + , bookings_source_src_10020.booking_value AS average_booking_value + , bookings_source_src_10020.booking_value AS booking_payments + , bookings_source_src_10020.is_instant + , bookings_source_src_10020.ds + , DATE_TRUNC('week', bookings_source_src_10020.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10020.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds) AS ds__year + , bookings_source_src_10020.ds_partitioned + , DATE_TRUNC('week', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__year + , bookings_source_src_10020.booking_paid_at + , DATE_TRUNC('week', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__week + , DATE_TRUNC('month', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__year + , bookings_source_src_10020.listing_id AS listing + , bookings_source_src_10020.guest_id AS guest + , bookings_source_src_10020.host_id AS host + , bookings_source_src_10020.guest_id AS user + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_0 ) subq_1 ) subq_2 @@ -147,36 +147,36 @@ FROM ( FROM ( -- Read Elements From Data Source 'listings' SELECT - listings_src_10020.active_from AS window_start - , DATE_TRUNC('week', listings_src_10020.active_from) AS window_start__week - , DATE_TRUNC('month', listings_src_10020.active_from) AS window_start__month - , DATE_TRUNC('quarter', listings_src_10020.active_from) AS window_start__quarter - , DATE_TRUNC('year', listings_src_10020.active_from) AS window_start__year - , listings_src_10020.active_to AS window_end - , DATE_TRUNC('week', listings_src_10020.active_to) AS window_end__week - , DATE_TRUNC('month', listings_src_10020.active_to) AS window_end__month - , DATE_TRUNC('quarter', listings_src_10020.active_to) AS window_end__quarter - , DATE_TRUNC('year', listings_src_10020.active_to) AS window_end__year - , listings_src_10020.country - , listings_src_10020.is_lux - , listings_src_10020.capacity - , listings_src_10020.active_from AS listing__window_start - , DATE_TRUNC('week', listings_src_10020.active_from) AS listing__window_start__week - , DATE_TRUNC('month', listings_src_10020.active_from) AS listing__window_start__month - , DATE_TRUNC('quarter', listings_src_10020.active_from) AS listing__window_start__quarter - , DATE_TRUNC('year', listings_src_10020.active_from) AS listing__window_start__year - , listings_src_10020.active_to AS listing__window_end - , DATE_TRUNC('week', listings_src_10020.active_to) AS listing__window_end__week - , DATE_TRUNC('month', listings_src_10020.active_to) AS listing__window_end__month - , DATE_TRUNC('quarter', listings_src_10020.active_to) AS listing__window_end__quarter - , DATE_TRUNC('year', listings_src_10020.active_to) AS listing__window_end__year - , listings_src_10020.country AS listing__country - , listings_src_10020.is_lux AS listing__is_lux - , listings_src_10020.capacity AS listing__capacity - , listings_src_10020.listing_id AS listing - , listings_src_10020.user_id AS user - , listings_src_10020.user_id AS listing__user - FROM ***************************.dim_listings listings_src_10020 + listings_src_10022.active_from AS window_start + , DATE_TRUNC('week', listings_src_10022.active_from) AS window_start__week + , DATE_TRUNC('month', listings_src_10022.active_from) AS window_start__month + , DATE_TRUNC('quarter', listings_src_10022.active_from) AS window_start__quarter + , DATE_TRUNC('year', listings_src_10022.active_from) AS window_start__year + , listings_src_10022.active_to AS window_end + , DATE_TRUNC('week', listings_src_10022.active_to) AS window_end__week + , DATE_TRUNC('month', listings_src_10022.active_to) AS window_end__month + , DATE_TRUNC('quarter', listings_src_10022.active_to) AS window_end__quarter + , DATE_TRUNC('year', listings_src_10022.active_to) AS window_end__year + , listings_src_10022.country + , listings_src_10022.is_lux + , listings_src_10022.capacity + , listings_src_10022.active_from AS listing__window_start + , DATE_TRUNC('week', listings_src_10022.active_from) AS listing__window_start__week + , DATE_TRUNC('month', listings_src_10022.active_from) AS listing__window_start__month + , DATE_TRUNC('quarter', listings_src_10022.active_from) AS listing__window_start__quarter + , DATE_TRUNC('year', listings_src_10022.active_from) AS listing__window_start__year + , listings_src_10022.active_to AS listing__window_end + , DATE_TRUNC('week', listings_src_10022.active_to) AS listing__window_end__week + , DATE_TRUNC('month', listings_src_10022.active_to) AS listing__window_end__month + , DATE_TRUNC('quarter', listings_src_10022.active_to) AS listing__window_end__quarter + , DATE_TRUNC('year', listings_src_10022.active_to) AS listing__window_end__year + , listings_src_10022.country AS listing__country + , listings_src_10022.is_lux AS listing__is_lux + , listings_src_10022.capacity AS listing__capacity + , listings_src_10022.listing_id AS listing + , listings_src_10022.user_id AS user + , listings_src_10022.user_id AS listing__user + FROM ***************************.dim_listings listings_src_10022 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -210,20 +210,20 @@ FROM ( FROM ( -- Read Elements From Data Source 'users_latest' SELECT - users_latest_src_10024.ds - , DATE_TRUNC('week', users_latest_src_10024.ds) AS ds__week - , DATE_TRUNC('month', users_latest_src_10024.ds) AS ds__month - , DATE_TRUNC('quarter', users_latest_src_10024.ds) AS ds__quarter - , DATE_TRUNC('year', users_latest_src_10024.ds) AS ds__year - , users_latest_src_10024.home_state_latest - , users_latest_src_10024.ds AS user__ds - , DATE_TRUNC('week', users_latest_src_10024.ds) AS user__ds__week - , DATE_TRUNC('month', users_latest_src_10024.ds) AS user__ds__month - , DATE_TRUNC('quarter', users_latest_src_10024.ds) AS user__ds__quarter - , DATE_TRUNC('year', users_latest_src_10024.ds) AS user__ds__year - , users_latest_src_10024.home_state_latest AS user__home_state_latest - , users_latest_src_10024.user_id AS user - FROM ***************************.dim_users_latest users_latest_src_10024 + users_latest_src_10026.ds + , DATE_TRUNC('week', users_latest_src_10026.ds) AS ds__week + , DATE_TRUNC('month', users_latest_src_10026.ds) AS ds__month + , DATE_TRUNC('quarter', users_latest_src_10026.ds) AS ds__quarter + , DATE_TRUNC('year', users_latest_src_10026.ds) AS ds__year + , users_latest_src_10026.home_state_latest + , users_latest_src_10026.ds AS user__ds + , DATE_TRUNC('week', users_latest_src_10026.ds) AS user__ds__week + , DATE_TRUNC('month', users_latest_src_10026.ds) AS user__ds__month + , DATE_TRUNC('quarter', users_latest_src_10026.ds) AS user__ds__quarter + , DATE_TRUNC('year', users_latest_src_10026.ds) AS user__ds__year + , users_latest_src_10026.home_state_latest AS user__home_state_latest + , users_latest_src_10026.user_id AS user + FROM ***************************.dim_users_latest users_latest_src_10026 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_through_scd_dimension__plan0_optimized.sql index 61eae48b58..db5c297049 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -16,22 +16,22 @@ FROM ( ds AS metric_time , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10018 + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_13 LEFT OUTER JOIN ( -- Join Standard Outputs -- Pass Only Elements: -- ['user__home_state_latest', 'window_start', 'window_end', 'listing'] SELECT - listings_src_10020.active_from AS window_start - , listings_src_10020.active_to AS window_end - , listings_src_10020.listing_id AS listing - , users_latest_src_10024.home_state_latest AS user__home_state_latest - FROM ***************************.dim_listings listings_src_10020 + listings_src_10022.active_from AS window_start + , listings_src_10022.active_to AS window_end + , listings_src_10022.listing_id AS listing + , users_latest_src_10026.home_state_latest AS user__home_state_latest + FROM ***************************.dim_listings listings_src_10022 LEFT OUTER JOIN - ***************************.dim_users_latest users_latest_src_10024 + ***************************.dim_users_latest users_latest_src_10026 ON - listings_src_10020.user_id = users_latest_src_10024.user_id + listings_src_10022.user_id = users_latest_src_10026.user_id ) subq_18 ON ( diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_to_scd_dimension__plan0.sql index f517949c7d..066f02057d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_to_scd_dimension__plan0.sql @@ -70,31 +70,31 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10018.booking_value - , bookings_source_src_10018.guest_id AS bookers - , bookings_source_src_10018.booking_value AS average_booking_value - , bookings_source_src_10018.booking_value AS booking_payments - , bookings_source_src_10018.is_instant - , bookings_source_src_10018.ds - , DATE_TRUNC('week', bookings_source_src_10018.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10018.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds) AS ds__year - , bookings_source_src_10018.ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__year - , bookings_source_src_10018.booking_paid_at - , DATE_TRUNC('week', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__week - , DATE_TRUNC('month', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__year - , bookings_source_src_10018.listing_id AS listing - , bookings_source_src_10018.guest_id AS guest - , bookings_source_src_10018.host_id AS host - , bookings_source_src_10018.guest_id AS user - FROM ***************************.fct_bookings bookings_source_src_10018 + , bookings_source_src_10020.booking_value + , bookings_source_src_10020.guest_id AS bookers + , bookings_source_src_10020.booking_value AS average_booking_value + , bookings_source_src_10020.booking_value AS booking_payments + , bookings_source_src_10020.is_instant + , bookings_source_src_10020.ds + , DATE_TRUNC('week', bookings_source_src_10020.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10020.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds) AS ds__year + , bookings_source_src_10020.ds_partitioned + , DATE_TRUNC('week', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__year + , bookings_source_src_10020.booking_paid_at + , DATE_TRUNC('week', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__week + , DATE_TRUNC('month', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__year + , bookings_source_src_10020.listing_id AS listing + , bookings_source_src_10020.guest_id AS guest + , bookings_source_src_10020.host_id AS host + , bookings_source_src_10020.guest_id AS user + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_0 ) subq_1 ) subq_2 @@ -129,10 +129,10 @@ FROM ( FROM ( -- Read Elements From Data Source 'lux_listing_mapping' SELECT - lux_listing_mapping_src_10021.listing_id AS listing - , lux_listing_mapping_src_10021.lux_listing_id AS lux_listing - , lux_listing_mapping_src_10021.lux_listing_id AS listing__lux_listing - FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10021 + lux_listing_mapping_src_10023.listing_id AS listing + , lux_listing_mapping_src_10023.lux_listing_id AS lux_listing + , lux_listing_mapping_src_10023.lux_listing_id AS listing__lux_listing + FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10023 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -186,30 +186,30 @@ FROM ( FROM ( -- Read Elements From Data Source 'lux_listings' SELECT - lux_listings_src_10022.valid_from AS window_start - , DATE_TRUNC('week', lux_listings_src_10022.valid_from) AS window_start__week - , DATE_TRUNC('month', lux_listings_src_10022.valid_from) AS window_start__month - , DATE_TRUNC('quarter', lux_listings_src_10022.valid_from) AS window_start__quarter - , DATE_TRUNC('year', lux_listings_src_10022.valid_from) AS window_start__year - , lux_listings_src_10022.valid_to AS window_end - , DATE_TRUNC('week', lux_listings_src_10022.valid_to) AS window_end__week - , DATE_TRUNC('month', lux_listings_src_10022.valid_to) AS window_end__month - , DATE_TRUNC('quarter', lux_listings_src_10022.valid_to) AS window_end__quarter - , DATE_TRUNC('year', lux_listings_src_10022.valid_to) AS window_end__year - , lux_listings_src_10022.is_confirmed_lux - , lux_listings_src_10022.valid_from AS lux_listing__window_start - , DATE_TRUNC('week', lux_listings_src_10022.valid_from) AS lux_listing__window_start__week - , DATE_TRUNC('month', lux_listings_src_10022.valid_from) AS lux_listing__window_start__month - , DATE_TRUNC('quarter', lux_listings_src_10022.valid_from) AS lux_listing__window_start__quarter - , DATE_TRUNC('year', lux_listings_src_10022.valid_from) AS lux_listing__window_start__year - , lux_listings_src_10022.valid_to AS lux_listing__window_end - , DATE_TRUNC('week', lux_listings_src_10022.valid_to) AS lux_listing__window_end__week - , DATE_TRUNC('month', lux_listings_src_10022.valid_to) AS lux_listing__window_end__month - , DATE_TRUNC('quarter', lux_listings_src_10022.valid_to) AS lux_listing__window_end__quarter - , DATE_TRUNC('year', lux_listings_src_10022.valid_to) AS lux_listing__window_end__year - , lux_listings_src_10022.is_confirmed_lux AS lux_listing__is_confirmed_lux - , lux_listings_src_10022.lux_listing_id AS lux_listing - FROM ***************************.dim_lux_listings lux_listings_src_10022 + lux_listings_src_10024.valid_from AS window_start + , DATE_TRUNC('week', lux_listings_src_10024.valid_from) AS window_start__week + , DATE_TRUNC('month', lux_listings_src_10024.valid_from) AS window_start__month + , DATE_TRUNC('quarter', lux_listings_src_10024.valid_from) AS window_start__quarter + , DATE_TRUNC('year', lux_listings_src_10024.valid_from) AS window_start__year + , lux_listings_src_10024.valid_to AS window_end + , DATE_TRUNC('week', lux_listings_src_10024.valid_to) AS window_end__week + , DATE_TRUNC('month', lux_listings_src_10024.valid_to) AS window_end__month + , DATE_TRUNC('quarter', lux_listings_src_10024.valid_to) AS window_end__quarter + , DATE_TRUNC('year', lux_listings_src_10024.valid_to) AS window_end__year + , lux_listings_src_10024.is_confirmed_lux + , lux_listings_src_10024.valid_from AS lux_listing__window_start + , DATE_TRUNC('week', lux_listings_src_10024.valid_from) AS lux_listing__window_start__week + , DATE_TRUNC('month', lux_listings_src_10024.valid_from) AS lux_listing__window_start__month + , DATE_TRUNC('quarter', lux_listings_src_10024.valid_from) AS lux_listing__window_start__quarter + , DATE_TRUNC('year', lux_listings_src_10024.valid_from) AS lux_listing__window_start__year + , lux_listings_src_10024.valid_to AS lux_listing__window_end + , DATE_TRUNC('week', lux_listings_src_10024.valid_to) AS lux_listing__window_end__week + , DATE_TRUNC('month', lux_listings_src_10024.valid_to) AS lux_listing__window_end__month + , DATE_TRUNC('quarter', lux_listings_src_10024.valid_to) AS lux_listing__window_end__quarter + , DATE_TRUNC('year', lux_listings_src_10024.valid_to) AS lux_listing__window_end__year + , lux_listings_src_10024.is_confirmed_lux AS lux_listing__is_confirmed_lux + , lux_listings_src_10024.lux_listing_id AS lux_listing + FROM ***************************.dim_lux_listings lux_listings_src_10024 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_to_scd_dimension__plan0_optimized.sql index d7d9f8b842..bdd70cecc4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -16,7 +16,7 @@ FROM ( ds AS metric_time , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10018 + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_13 LEFT OUTER JOIN ( -- Join Standard Outputs @@ -26,15 +26,15 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end', -- 'listing'] SELECT - lux_listings_src_10022.valid_from AS lux_listing__window_start - , lux_listings_src_10022.valid_to AS lux_listing__window_end - , lux_listing_mapping_src_10021.listing_id AS listing - , lux_listings_src_10022.is_confirmed_lux AS lux_listing__is_confirmed_lux - FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10021 + lux_listings_src_10024.valid_from AS lux_listing__window_start + , lux_listings_src_10024.valid_to AS lux_listing__window_end + , lux_listing_mapping_src_10023.listing_id AS listing + , lux_listings_src_10024.is_confirmed_lux AS lux_listing__is_confirmed_lux + FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10023 LEFT OUTER JOIN - ***************************.dim_lux_listings lux_listings_src_10022 + ***************************.dim_lux_listings lux_listings_src_10024 ON - lux_listing_mapping_src_10021.lux_listing_id = lux_listings_src_10022.lux_listing_id + lux_listing_mapping_src_10023.lux_listing_id = lux_listings_src_10024.lux_listing_id ) subq_18 ON ( diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_join_node__plan0.sql index b853ede081..aab559dc28 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_join_node__plan0.sql @@ -82,38 +82,38 @@ LEFT OUTER JOIN ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_2 ) subq_3 ON @@ -128,38 +128,38 @@ LEFT OUTER JOIN ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_join_node__plan0_optimized.sql index 1093bb0b49..b9b3110aab 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multi_join_node__plan0_optimized.sql @@ -23,7 +23,7 @@ LEFT OUTER JOIN ( SELECT listing_id AS listing , country AS country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_9 ON subq_7.listing = subq_9.listing @@ -34,7 +34,7 @@ LEFT OUTER JOIN ( SELECT listing_id AS listing , country AS country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_11 ON subq_7.listing = subq_11.listing diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multihop_node__plan0.sql index eb170aa5f4..58aa9d73cf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multihop_node__plan0.sql @@ -63,31 +63,31 @@ FROM ( FROM ( -- Read Elements From Data Source 'account_month_txns' SELECT - account_month_txns_src_10010.txn_count - , account_month_txns_src_10010.ds_partitioned - , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year - , account_month_txns_src_10010.ds - , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week - , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month - , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter - , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year - , account_month_txns_src_10010.account_month - , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned - , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week - , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month - , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter - , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year - , account_month_txns_src_10010.ds AS account_id__ds - , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week - , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month - , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter - , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year - , account_month_txns_src_10010.account_month AS account_id__account_month - , account_month_txns_src_10010.account_id - FROM ***************************.account_month_txns account_month_txns_src_10010 + account_month_txns_src_10012.txn_count + , account_month_txns_src_10012.ds_partitioned + , DATE_TRUNC('week', account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__year + , account_month_txns_src_10012.ds + , DATE_TRUNC('week', account_month_txns_src_10012.ds) AS ds__week + , DATE_TRUNC('month', account_month_txns_src_10012.ds) AS ds__month + , DATE_TRUNC('quarter', account_month_txns_src_10012.ds) AS ds__quarter + , DATE_TRUNC('year', account_month_txns_src_10012.ds) AS ds__year + , account_month_txns_src_10012.account_month + , account_month_txns_src_10012.ds_partitioned AS account_id__ds_partitioned + , DATE_TRUNC('week', account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__week + , DATE_TRUNC('month', account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__month + , DATE_TRUNC('quarter', account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__quarter + , DATE_TRUNC('year', account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__year + , account_month_txns_src_10012.ds AS account_id__ds + , DATE_TRUNC('week', account_month_txns_src_10012.ds) AS account_id__ds__week + , DATE_TRUNC('month', account_month_txns_src_10012.ds) AS account_id__ds__month + , DATE_TRUNC('quarter', account_month_txns_src_10012.ds) AS account_id__ds__quarter + , DATE_TRUNC('year', account_month_txns_src_10012.ds) AS account_id__ds__year + , account_month_txns_src_10012.account_month AS account_id__account_month + , account_month_txns_src_10012.account_id + FROM ***************************.account_month_txns account_month_txns_src_10012 ) subq_0 ) subq_1 ) subq_2 @@ -126,22 +126,22 @@ FROM ( FROM ( -- Read Elements From Data Source 'bridge_table' SELECT - bridge_table_src_10011.extra_dim - , bridge_table_src_10011.ds_partitioned - , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year - , bridge_table_src_10011.extra_dim AS account_id__extra_dim - , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned - , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week - , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month - , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter - , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year - , bridge_table_src_10011.account_id - , bridge_table_src_10011.customer_id - , bridge_table_src_10011.customer_id AS account_id__customer_id - FROM ***************************.bridge_table bridge_table_src_10011 + bridge_table_src_10013.extra_dim + , bridge_table_src_10013.ds_partitioned + , DATE_TRUNC('week', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__year + , bridge_table_src_10013.extra_dim AS account_id__extra_dim + , bridge_table_src_10013.ds_partitioned AS account_id__ds_partitioned + , DATE_TRUNC('week', bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__week + , DATE_TRUNC('month', bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__month + , DATE_TRUNC('quarter', bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__quarter + , DATE_TRUNC('year', bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__year + , bridge_table_src_10013.account_id + , bridge_table_src_10013.customer_id + , bridge_table_src_10013.customer_id AS account_id__customer_id + FROM ***************************.bridge_table bridge_table_src_10013 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -179,22 +179,22 @@ FROM ( FROM ( -- Read Elements From Data Source 'customer_table' SELECT - customer_table_src_10013.customer_name - , customer_table_src_10013.customer_atomic_weight - , customer_table_src_10013.ds_partitioned - , DATE_TRUNC('week', customer_table_src_10013.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year - , customer_table_src_10013.customer_name AS customer_id__customer_name - , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight - , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned - , DATE_TRUNC('week', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__week - , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month - , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter - , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year - , customer_table_src_10013.customer_id - FROM ***************************.customer_table customer_table_src_10013 + customer_table_src_10015.customer_name + , customer_table_src_10015.customer_atomic_weight + , customer_table_src_10015.ds_partitioned + , DATE_TRUNC('week', customer_table_src_10015.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', customer_table_src_10015.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', customer_table_src_10015.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', customer_table_src_10015.ds_partitioned) AS ds_partitioned__year + , customer_table_src_10015.customer_name AS customer_id__customer_name + , customer_table_src_10015.customer_atomic_weight AS customer_id__customer_atomic_weight + , customer_table_src_10015.ds_partitioned AS customer_id__ds_partitioned + , DATE_TRUNC('week', customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__week + , DATE_TRUNC('month', customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__month + , DATE_TRUNC('quarter', customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__quarter + , DATE_TRUNC('year', customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__year + , customer_table_src_10015.customer_id + FROM ***************************.customer_table customer_table_src_10015 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multihop_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multihop_node__plan0_optimized.sql index 1bd003f415..d64e2a881b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multihop_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multihop_node__plan0_optimized.sql @@ -5,31 +5,31 @@ -- Compute Metrics via Expressions SELECT subq_18.customer_id__customer_name AS account_id__customer_id__customer_name - , SUM(account_month_txns_src_10010.txn_count) AS txn_count -FROM ***************************.account_month_txns account_month_txns_src_10010 + , SUM(account_month_txns_src_10012.txn_count) AS txn_count +FROM ***************************.account_month_txns account_month_txns_src_10012 LEFT OUTER JOIN ( -- Join Standard Outputs -- Pass Only Elements: -- ['customer_id__customer_name', 'ds_partitioned', 'account_id'] SELECT - bridge_table_src_10011.ds_partitioned AS ds_partitioned - , bridge_table_src_10011.account_id AS account_id - , customer_table_src_10013.customer_name AS customer_id__customer_name - FROM ***************************.bridge_table bridge_table_src_10011 + bridge_table_src_10013.ds_partitioned AS ds_partitioned + , bridge_table_src_10013.account_id AS account_id + , customer_table_src_10015.customer_name AS customer_id__customer_name + FROM ***************************.bridge_table bridge_table_src_10013 LEFT OUTER JOIN - ***************************.customer_table customer_table_src_10013 + ***************************.customer_table customer_table_src_10015 ON ( - bridge_table_src_10011.customer_id = customer_table_src_10013.customer_id + bridge_table_src_10013.customer_id = customer_table_src_10015.customer_id ) AND ( - bridge_table_src_10011.ds_partitioned = customer_table_src_10013.ds_partitioned + bridge_table_src_10013.ds_partitioned = customer_table_src_10015.ds_partitioned ) ) subq_18 ON ( - account_month_txns_src_10010.account_id = subq_18.account_id + account_month_txns_src_10012.account_id = subq_18.account_id ) AND ( - account_month_txns_src_10010.ds_partitioned = subq_18.ds_partitioned + account_month_txns_src_10012.ds_partitioned = subq_18.ds_partitioned ) GROUP BY subq_18.customer_id__customer_name diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multiple_metrics_no_dimensions__plan0.sql index 51f635d033..c710a9f5b1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multiple_metrics_no_dimensions__plan0.sql @@ -299,38 +299,38 @@ CROSS JOIN ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_6 ) subq_7 WHERE subq_7.metric_time BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multiple_metrics_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multiple_metrics_no_dimensions__plan0_optimized.sql index 5c3efab0d7..ea6d50b216 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multiple_metrics_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_multiple_metrics_no_dimensions__plan0_optimized.sql @@ -28,6 +28,6 @@ CROSS JOIN ( -- Compute Metrics via Expressions SELECT SUM(1) AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 WHERE created_at BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) ) subq_23 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_partitioned_join__plan0.sql index a664f1546a..8d3716a98c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_partitioned_join__plan0.sql @@ -66,32 +66,32 @@ FROM ( -- Read Elements From Data Source 'id_verifications' SELECT 1 AS identity_verifications - , id_verifications_src_10003.ds - , DATE_TRUNC('week', id_verifications_src_10003.ds) AS ds__week - , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , id_verifications_src_10003.ds_partitioned - , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , id_verifications_src_10003.verification_type - , id_verifications_src_10003.ds AS verification__ds - , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week - , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned - , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week - , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , id_verifications_src_10003.verification_type AS verification__verification_type - , id_verifications_src_10003.verification_id AS verification - , id_verifications_src_10003.user_id AS user - , id_verifications_src_10003.user_id AS verification__user - FROM ***************************.fct_id_verifications id_verifications_src_10003 + , id_verifications_src_10004.ds + , DATE_TRUNC('week', id_verifications_src_10004.ds) AS ds__week + , DATE_TRUNC('month', id_verifications_src_10004.ds) AS ds__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds) AS ds__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds) AS ds__year + , id_verifications_src_10004.ds_partitioned + , DATE_TRUNC('week', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__year + , id_verifications_src_10004.verification_type + , id_verifications_src_10004.ds AS verification__ds + , DATE_TRUNC('week', id_verifications_src_10004.ds) AS verification__ds__week + , DATE_TRUNC('month', id_verifications_src_10004.ds) AS verification__ds__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds) AS verification__ds__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds) AS verification__ds__year + , id_verifications_src_10004.ds_partitioned AS verification__ds_partitioned + , DATE_TRUNC('week', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__week + , DATE_TRUNC('month', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__year + , id_verifications_src_10004.verification_type AS verification__verification_type + , id_verifications_src_10004.verification_id AS verification + , id_verifications_src_10004.user_id AS user + , id_verifications_src_10004.user_id AS verification__user + FROM ***************************.fct_id_verifications id_verifications_src_10004 ) subq_0 ) subq_1 ) subq_2 @@ -105,40 +105,40 @@ FROM ( FROM ( -- Read Elements From Data Source 'users_ds_source' SELECT - users_ds_source_src_10007.ds - , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS ds__week - , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year - , users_ds_source_src_10007.created_at - , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week - , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year - , users_ds_source_src_10007.ds_partitioned - , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year - , users_ds_source_src_10007.home_state - , users_ds_source_src_10007.ds AS user__ds - , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week - , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year - , users_ds_source_src_10007.created_at AS user__created_at - , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week - , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year - , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned - , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week - , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year - , users_ds_source_src_10007.home_state AS user__home_state - , users_ds_source_src_10007.user_id AS user - FROM ***************************.dim_users users_ds_source_src_10007 + users_ds_source_src_10008.ds + , DATE_TRUNC('week', users_ds_source_src_10008.ds) AS ds__week + , DATE_TRUNC('month', users_ds_source_src_10008.ds) AS ds__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.ds) AS ds__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.ds) AS ds__year + , users_ds_source_src_10008.created_at + , DATE_TRUNC('week', users_ds_source_src_10008.created_at) AS created_at__week + , DATE_TRUNC('month', users_ds_source_src_10008.created_at) AS created_at__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.created_at) AS created_at__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.created_at) AS created_at__year + , users_ds_source_src_10008.ds_partitioned + , DATE_TRUNC('week', users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__year + , users_ds_source_src_10008.home_state + , users_ds_source_src_10008.ds AS user__ds + , DATE_TRUNC('week', users_ds_source_src_10008.ds) AS user__ds__week + , DATE_TRUNC('month', users_ds_source_src_10008.ds) AS user__ds__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.ds) AS user__ds__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.ds) AS user__ds__year + , users_ds_source_src_10008.created_at AS user__created_at + , DATE_TRUNC('week', users_ds_source_src_10008.created_at) AS user__created_at__week + , DATE_TRUNC('month', users_ds_source_src_10008.created_at) AS user__created_at__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.created_at) AS user__created_at__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.created_at) AS user__created_at__year + , users_ds_source_src_10008.ds_partitioned AS user__ds_partitioned + , DATE_TRUNC('week', users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__week + , DATE_TRUNC('month', users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__year + , users_ds_source_src_10008.home_state AS user__home_state + , users_ds_source_src_10008.user_id AS user + FROM ***************************.dim_users users_ds_source_src_10008 ) subq_3 ) subq_4 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_partitioned_join__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_partitioned_join__plan0_optimized.sql index 5820233b25..9b594d5d61 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_partitioned_join__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_partitioned_join__plan0_optimized.sql @@ -4,7 +4,7 @@ -- Aggregate Measures -- Compute Metrics via Expressions SELECT - users_ds_source_src_10007.home_state AS user__home_state + users_ds_source_src_10008.home_state AS user__home_state , SUM(subq_10.identity_verifications) AS identity_verifications FROM ( -- Read Elements From Data Source 'id_verifications' @@ -15,15 +15,15 @@ FROM ( ds_partitioned , user_id AS user , 1 AS identity_verifications - FROM ***************************.fct_id_verifications id_verifications_src_10003 + FROM ***************************.fct_id_verifications id_verifications_src_10004 ) subq_10 LEFT OUTER JOIN - ***************************.dim_users users_ds_source_src_10007 + ***************************.dim_users users_ds_source_src_10008 ON ( - subq_10.user = users_ds_source_src_10007.user_id + subq_10.user = users_ds_source_src_10008.user_id ) AND ( - subq_10.ds_partitioned = users_ds_source_src_10007.ds_partitioned + subq_10.ds_partitioned = users_ds_source_src_10008.ds_partitioned ) GROUP BY - users_ds_source_src_10007.home_state + users_ds_source_src_10008.home_state diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_single_join_node__plan0.sql index 59f0e2fa56..2bb130ac42 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_single_join_node__plan0.sql @@ -81,38 +81,38 @@ LEFT OUTER JOIN ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_2 ) subq_3 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_single_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_single_join_node__plan0_optimized.sql index 3a3acc15c9..9e84b7a7a8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_single_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_single_join_node__plan0_optimized.sql @@ -1,7 +1,7 @@ -- Join Standard Outputs SELECT subq_5.listing AS listing - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , subq_5.bookings AS bookings FROM ( -- Read Elements From Data Source 'bookings_source' @@ -16,6 +16,6 @@ FROM ( ) bookings_source_src_10001 ) subq_5 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_5.listing = listings_latest_src_10004.listing_id + subq_5.listing = listings_latest_src_10005.listing_id diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier__plan0.sql index 19c7d6a3ca..91cac67684 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier__plan0.sql @@ -46,24 +46,24 @@ FROM ( -- Read Elements From Data Source 'messages_source' SELECT 1 AS messages - , messages_source_src_10015.ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS ds__year - , messages_source_src_10015.team_id - , messages_source_src_10015.ds AS user_id__ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS user_id__ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS user_id__ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS user_id__ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS user_id__ds__year - , messages_source_src_10015.team_id AS user_id__team_id - , messages_source_src_10015.user_id - , messages_source_src_10015.team_id AS user_team___team_id - , messages_source_src_10015.user_id AS user_team___user_id - , messages_source_src_10015.team_id AS user_id__user_team___team_id - , messages_source_src_10015.user_id AS user_id__user_team___user_id - FROM ***************************.fct_messages messages_source_src_10015 + , messages_source_src_10017.ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS ds__year + , messages_source_src_10017.team_id + , messages_source_src_10017.ds AS user_id__ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS user_id__ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS user_id__ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS user_id__ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS user_id__ds__year + , messages_source_src_10017.team_id AS user_id__team_id + , messages_source_src_10017.user_id + , messages_source_src_10017.team_id AS user_team___team_id + , messages_source_src_10017.user_id AS user_team___user_id + , messages_source_src_10017.team_id AS user_id__user_team___team_id + , messages_source_src_10017.user_id AS user_id__user_team___user_id + FROM ***************************.fct_messages messages_source_src_10017 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier__plan0_optimized.sql index 5874a6ce5c..5d6458aa19 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( team_id AS user_team___team_id , user_id AS user_team___user_id , 1 AS messages - FROM ***************************.fct_messages messages_source_src_10015 + FROM ***************************.fct_messages messages_source_src_10017 ) subq_6 GROUP BY user_team___team_id diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_join__plan0.sql index f0944ea181..db32ddab0d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_join__plan0.sql @@ -63,24 +63,24 @@ FROM ( -- Read Elements From Data Source 'messages_source' SELECT 1 AS messages - , messages_source_src_10015.ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS ds__year - , messages_source_src_10015.team_id - , messages_source_src_10015.ds AS user_id__ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS user_id__ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS user_id__ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS user_id__ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS user_id__ds__year - , messages_source_src_10015.team_id AS user_id__team_id - , messages_source_src_10015.user_id - , messages_source_src_10015.team_id AS user_team___team_id - , messages_source_src_10015.user_id AS user_team___user_id - , messages_source_src_10015.team_id AS user_id__user_team___team_id - , messages_source_src_10015.user_id AS user_id__user_team___user_id - FROM ***************************.fct_messages messages_source_src_10015 + , messages_source_src_10017.ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS ds__year + , messages_source_src_10017.team_id + , messages_source_src_10017.ds AS user_id__ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS user_id__ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS user_id__ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS user_id__ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS user_id__ds__year + , messages_source_src_10017.team_id AS user_id__team_id + , messages_source_src_10017.user_id + , messages_source_src_10017.team_id AS user_team___team_id + , messages_source_src_10017.user_id AS user_team___user_id + , messages_source_src_10017.team_id AS user_id__user_team___team_id + , messages_source_src_10017.user_id AS user_id__user_team___user_id + FROM ***************************.fct_messages messages_source_src_10017 ) subq_0 ) subq_1 ) subq_2 @@ -94,50 +94,50 @@ FROM ( FROM ( -- Read Elements From Data Source 'users_source' SELECT - users_source_src_10017.created_at AS ds - , DATE_TRUNC('week', users_source_src_10017.created_at) AS ds__week - , DATE_TRUNC('month', users_source_src_10017.created_at) AS ds__month - , DATE_TRUNC('quarter', users_source_src_10017.created_at) AS ds__quarter - , DATE_TRUNC('year', users_source_src_10017.created_at) AS ds__year - , users_source_src_10017.team_id - , users_source_src_10017.country - , users_source_src_10017.created_at AS user_id__ds - , DATE_TRUNC('week', users_source_src_10017.created_at) AS user_id__ds__week - , DATE_TRUNC('month', users_source_src_10017.created_at) AS user_id__ds__month - , DATE_TRUNC('quarter', users_source_src_10017.created_at) AS user_id__ds__quarter - , DATE_TRUNC('year', users_source_src_10017.created_at) AS user_id__ds__year - , users_source_src_10017.team_id AS user_id__team_id - , users_source_src_10017.country AS user_id__country - , users_source_src_10017.created_at AS user_composite_ident_2__ds - , DATE_TRUNC('week', users_source_src_10017.created_at) AS user_composite_ident_2__ds__week - , DATE_TRUNC('month', users_source_src_10017.created_at) AS user_composite_ident_2__ds__month - , DATE_TRUNC('quarter', users_source_src_10017.created_at) AS user_composite_ident_2__ds__quarter - , DATE_TRUNC('year', users_source_src_10017.created_at) AS user_composite_ident_2__ds__year - , users_source_src_10017.team_id AS user_composite_ident_2__team_id - , users_source_src_10017.country AS user_composite_ident_2__country - , users_source_src_10017.created_at AS user_team__ds - , DATE_TRUNC('week', users_source_src_10017.created_at) AS user_team__ds__week - , DATE_TRUNC('month', users_source_src_10017.created_at) AS user_team__ds__month - , DATE_TRUNC('quarter', users_source_src_10017.created_at) AS user_team__ds__quarter - , DATE_TRUNC('year', users_source_src_10017.created_at) AS user_team__ds__year - , users_source_src_10017.team_id AS user_team__team_id - , users_source_src_10017.country AS user_team__country - , users_source_src_10017.id AS user_id - , users_source_src_10017.ident_2 AS user_composite_ident_2___ident_2 - , users_source_src_10017.id AS user_composite_ident_2___user_id - , users_source_src_10017.team_id AS user_team___team_id - , users_source_src_10017.id AS user_team___user_id - , users_source_src_10017.ident_2 AS user_id__user_composite_ident_2___ident_2 - , users_source_src_10017.id AS user_id__user_composite_ident_2___user_id - , users_source_src_10017.team_id AS user_id__user_team___team_id - , users_source_src_10017.id AS user_id__user_team___user_id - , users_source_src_10017.id AS user_composite_ident_2__user_id - , users_source_src_10017.team_id AS user_composite_ident_2__user_team___team_id - , users_source_src_10017.id AS user_composite_ident_2__user_team___user_id - , users_source_src_10017.id AS user_team__user_id - , users_source_src_10017.ident_2 AS user_team__user_composite_ident_2___ident_2 - , users_source_src_10017.id AS user_team__user_composite_ident_2___user_id - FROM ***************************.fct_users users_source_src_10017 + users_source_src_10019.created_at AS ds + , DATE_TRUNC('week', users_source_src_10019.created_at) AS ds__week + , DATE_TRUNC('month', users_source_src_10019.created_at) AS ds__month + , DATE_TRUNC('quarter', users_source_src_10019.created_at) AS ds__quarter + , DATE_TRUNC('year', users_source_src_10019.created_at) AS ds__year + , users_source_src_10019.team_id + , users_source_src_10019.country + , users_source_src_10019.created_at AS user_id__ds + , DATE_TRUNC('week', users_source_src_10019.created_at) AS user_id__ds__week + , DATE_TRUNC('month', users_source_src_10019.created_at) AS user_id__ds__month + , DATE_TRUNC('quarter', users_source_src_10019.created_at) AS user_id__ds__quarter + , DATE_TRUNC('year', users_source_src_10019.created_at) AS user_id__ds__year + , users_source_src_10019.team_id AS user_id__team_id + , users_source_src_10019.country AS user_id__country + , users_source_src_10019.created_at AS user_composite_ident_2__ds + , DATE_TRUNC('week', users_source_src_10019.created_at) AS user_composite_ident_2__ds__week + , DATE_TRUNC('month', users_source_src_10019.created_at) AS user_composite_ident_2__ds__month + , DATE_TRUNC('quarter', users_source_src_10019.created_at) AS user_composite_ident_2__ds__quarter + , DATE_TRUNC('year', users_source_src_10019.created_at) AS user_composite_ident_2__ds__year + , users_source_src_10019.team_id AS user_composite_ident_2__team_id + , users_source_src_10019.country AS user_composite_ident_2__country + , users_source_src_10019.created_at AS user_team__ds + , DATE_TRUNC('week', users_source_src_10019.created_at) AS user_team__ds__week + , DATE_TRUNC('month', users_source_src_10019.created_at) AS user_team__ds__month + , DATE_TRUNC('quarter', users_source_src_10019.created_at) AS user_team__ds__quarter + , DATE_TRUNC('year', users_source_src_10019.created_at) AS user_team__ds__year + , users_source_src_10019.team_id AS user_team__team_id + , users_source_src_10019.country AS user_team__country + , users_source_src_10019.id AS user_id + , users_source_src_10019.ident_2 AS user_composite_ident_2___ident_2 + , users_source_src_10019.id AS user_composite_ident_2___user_id + , users_source_src_10019.team_id AS user_team___team_id + , users_source_src_10019.id AS user_team___user_id + , users_source_src_10019.ident_2 AS user_id__user_composite_ident_2___ident_2 + , users_source_src_10019.id AS user_id__user_composite_ident_2___user_id + , users_source_src_10019.team_id AS user_id__user_team___team_id + , users_source_src_10019.id AS user_id__user_team___user_id + , users_source_src_10019.id AS user_composite_ident_2__user_id + , users_source_src_10019.team_id AS user_composite_ident_2__user_team___team_id + , users_source_src_10019.id AS user_composite_ident_2__user_team___user_id + , users_source_src_10019.id AS user_team__user_id + , users_source_src_10019.ident_2 AS user_team__user_composite_ident_2___ident_2 + , users_source_src_10019.id AS user_team__user_composite_ident_2___user_id + FROM ***************************.fct_users users_source_src_10019 ) subq_3 ) subq_4 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_join__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_join__plan0_optimized.sql index 197f4ee9ff..d1a7f469af 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_join__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_join__plan0_optimized.sql @@ -6,7 +6,7 @@ SELECT subq_10.user_team___team_id AS user_team___team_id , subq_10.user_team___user_id AS user_team___user_id - , users_source_src_10017.country AS user_team__country + , users_source_src_10019.country AS user_team__country , SUM(subq_10.messages) AS messages FROM ( -- Read Elements From Data Source 'messages_source' @@ -17,17 +17,17 @@ FROM ( team_id AS user_team___team_id , user_id AS user_team___user_id , 1 AS messages - FROM ***************************.fct_messages messages_source_src_10015 + FROM ***************************.fct_messages messages_source_src_10017 ) subq_10 LEFT OUTER JOIN - ***************************.fct_users users_source_src_10017 + ***************************.fct_users users_source_src_10019 ON ( - subq_10.user_team___team_id = users_source_src_10017.team_id + subq_10.user_team___team_id = users_source_src_10019.team_id ) AND ( - subq_10.user_team___user_id = users_source_src_10017.id + subq_10.user_team___user_id = users_source_src_10019.id ) GROUP BY subq_10.user_team___team_id , subq_10.user_team___user_id - , users_source_src_10017.country + , users_source_src_10019.country diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_order_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_order_by__plan0.sql index 729cf82253..a9238e4659 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_order_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_order_by__plan0.sql @@ -52,24 +52,24 @@ FROM ( -- Read Elements From Data Source 'messages_source' SELECT 1 AS messages - , messages_source_src_10015.ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS ds__year - , messages_source_src_10015.team_id - , messages_source_src_10015.ds AS user_id__ds - , DATE_TRUNC('week', messages_source_src_10015.ds) AS user_id__ds__week - , DATE_TRUNC('month', messages_source_src_10015.ds) AS user_id__ds__month - , DATE_TRUNC('quarter', messages_source_src_10015.ds) AS user_id__ds__quarter - , DATE_TRUNC('year', messages_source_src_10015.ds) AS user_id__ds__year - , messages_source_src_10015.team_id AS user_id__team_id - , messages_source_src_10015.user_id - , messages_source_src_10015.team_id AS user_team___team_id - , messages_source_src_10015.user_id AS user_team___user_id - , messages_source_src_10015.team_id AS user_id__user_team___team_id - , messages_source_src_10015.user_id AS user_id__user_team___user_id - FROM ***************************.fct_messages messages_source_src_10015 + , messages_source_src_10017.ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS ds__year + , messages_source_src_10017.team_id + , messages_source_src_10017.ds AS user_id__ds + , DATE_TRUNC('week', messages_source_src_10017.ds) AS user_id__ds__week + , DATE_TRUNC('month', messages_source_src_10017.ds) AS user_id__ds__month + , DATE_TRUNC('quarter', messages_source_src_10017.ds) AS user_id__ds__quarter + , DATE_TRUNC('year', messages_source_src_10017.ds) AS user_id__ds__year + , messages_source_src_10017.team_id AS user_id__team_id + , messages_source_src_10017.user_id + , messages_source_src_10017.team_id AS user_team___team_id + , messages_source_src_10017.user_id AS user_team___user_id + , messages_source_src_10017.team_id AS user_id__user_team___team_id + , messages_source_src_10017.user_id AS user_id__user_team___user_id + FROM ***************************.fct_messages messages_source_src_10017 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_order_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_order_by__plan0_optimized.sql index 0d8ba1d7e2..2704ce4673 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_order_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_composite_identifier_with_order_by__plan0_optimized.sql @@ -14,7 +14,7 @@ FROM ( team_id AS user_team___team_id , user_id AS user_team___user_id , 1 AS messages - FROM ***************************.fct_messages messages_source_src_10015 + FROM ***************************.fct_messages messages_source_src_10017 ) subq_7 GROUP BY user_team___team_id diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node__plan0.sql index 14643e6eb2..a80874cda0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node__plan0.sql @@ -93,38 +93,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_2 ) subq_3 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node__plan0_optimized.sql index c92dc4aec4..4ded6af2e2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node__plan0_optimized.sql @@ -3,7 +3,7 @@ -- Compute Metrics via Expressions SELECT subq_7.listing AS listing - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_7.bookings) AS bookings FROM ( -- Read Elements From Data Source 'bookings_source' @@ -18,9 +18,9 @@ FROM ( ) bookings_source_src_10001 ) subq_7 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_7.listing = listings_latest_src_10004.listing_id + subq_7.listing = listings_latest_src_10005.listing_id GROUP BY subq_7.listing - , listings_latest_src_10004.country + , listings_latest_src_10005.country diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.sql index b8bab91048..49f3d35292 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.sql @@ -218,38 +218,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_3 ) subq_4 ) subq_5 @@ -326,35 +326,35 @@ FROM ( -- Read Elements From Data Source 'views_source' SELECT 1 AS views - , views_source_src_10009.ds - , DATE_TRUNC('week', views_source_src_10009.ds) AS ds__week - , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month - , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter - , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year - , views_source_src_10009.ds_partitioned - , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year - , views_source_src_10009.ds AS create_a_cycle_in_the_join_graph__ds - , DATE_TRUNC('week', views_source_src_10009.ds) AS create_a_cycle_in_the_join_graph__ds__week - , DATE_TRUNC('month', views_source_src_10009.ds) AS create_a_cycle_in_the_join_graph__ds__month - , DATE_TRUNC('quarter', views_source_src_10009.ds) AS create_a_cycle_in_the_join_graph__ds__quarter - , DATE_TRUNC('year', views_source_src_10009.ds) AS create_a_cycle_in_the_join_graph__ds__year - , views_source_src_10009.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , views_source_src_10009.listing_id AS listing - , views_source_src_10009.user_id AS user - , views_source_src_10009.user_id AS create_a_cycle_in_the_join_graph - , views_source_src_10009.listing_id AS create_a_cycle_in_the_join_graph__listing - , views_source_src_10009.user_id AS create_a_cycle_in_the_join_graph__user + , views_source_src_10010.ds + , DATE_TRUNC('week', views_source_src_10010.ds) AS ds__week + , DATE_TRUNC('month', views_source_src_10010.ds) AS ds__month + , DATE_TRUNC('quarter', views_source_src_10010.ds) AS ds__quarter + , DATE_TRUNC('year', views_source_src_10010.ds) AS ds__year + , views_source_src_10010.ds_partitioned + , DATE_TRUNC('week', views_source_src_10010.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', views_source_src_10010.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', views_source_src_10010.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', views_source_src_10010.ds_partitioned) AS ds_partitioned__year + , views_source_src_10010.ds AS create_a_cycle_in_the_join_graph__ds + , DATE_TRUNC('week', views_source_src_10010.ds) AS create_a_cycle_in_the_join_graph__ds__week + , DATE_TRUNC('month', views_source_src_10010.ds) AS create_a_cycle_in_the_join_graph__ds__month + , DATE_TRUNC('quarter', views_source_src_10010.ds) AS create_a_cycle_in_the_join_graph__ds__quarter + , DATE_TRUNC('year', views_source_src_10010.ds) AS create_a_cycle_in_the_join_graph__ds__year + , views_source_src_10010.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned + , DATE_TRUNC('week', views_source_src_10010.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__week + , DATE_TRUNC('month', views_source_src_10010.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__month + , DATE_TRUNC('quarter', views_source_src_10010.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter + , DATE_TRUNC('year', views_source_src_10010.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__year + , views_source_src_10010.listing_id AS listing + , views_source_src_10010.user_id AS user + , views_source_src_10010.user_id AS create_a_cycle_in_the_join_graph + , views_source_src_10010.listing_id AS create_a_cycle_in_the_join_graph__listing + , views_source_src_10010.user_id AS create_a_cycle_in_the_join_graph__user FROM ( -- User Defined SQL Query SELECT user_id, listing_id, ds, ds_partitioned FROM ***************************.fct_views - ) views_source_src_10009 + ) views_source_src_10010 ) subq_9 ) subq_10 ) subq_11 @@ -408,38 +408,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_12 ) subq_13 ) subq_14 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0_optimized.sql index 781f6c5d70..6d7ffc49a7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( -- Aggregate Measures SELECT subq_22.ds AS ds - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_22.bookings) AS bookings FROM ( -- Read Elements From Data Source 'bookings_source' @@ -30,12 +30,12 @@ FROM ( ) bookings_source_src_10001 ) subq_22 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_22.listing = listings_latest_src_10004.listing_id + subq_22.listing = listings_latest_src_10005.listing_id GROUP BY subq_22.ds - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_28 INNER JOIN ( -- Join Standard Outputs @@ -44,7 +44,7 @@ INNER JOIN ( -- Aggregate Measures SELECT subq_31.ds AS ds - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_31.views) AS views FROM ( -- Read Elements From Data Source 'views_source' @@ -58,15 +58,15 @@ INNER JOIN ( FROM ( -- User Defined SQL Query SELECT user_id, listing_id, ds, ds_partitioned FROM ***************************.fct_views - ) views_source_src_10009 + ) views_source_src_10010 ) subq_31 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_31.listing = listings_latest_src_10004.listing_id + subq_31.listing = listings_latest_src_10005.listing_id GROUP BY subq_31.ds - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_37 ON ( diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0.sql index ef5e4f07a3..c16b1acfd2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0.sql @@ -96,38 +96,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_2 ) subq_3 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0_optimized.sql index b712c6ecf8..69749ced9c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_ratio_from_single_data_source__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Aggregate Measures SELECT subq_7.listing AS listing - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_7.bookings) AS bookings , COUNT(DISTINCT subq_7.bookers) AS bookers FROM ( @@ -25,10 +25,10 @@ FROM ( ) bookings_source_src_10001 ) subq_7 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_7.listing = listings_latest_src_10004.listing_id + subq_7.listing = listings_latest_src_10005.listing_id GROUP BY subq_7.listing - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_11 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_simple_expr__plan0.sql index af06dc32a0..77fdc2484f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_simple_expr__plan0.sql @@ -93,38 +93,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_2 ) subq_3 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_simple_expr__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_simple_expr__plan0_optimized.sql index cbc93f25c5..be8c4f681b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_simple_expr__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_compute_metrics_node_simple_expr__plan0_optimized.sql @@ -8,17 +8,17 @@ FROM ( -- Aggregate Measures SELECT bookings_source_src_10001.listing_id AS listing - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(bookings_source_src_10001.booking_value) AS booking_value FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_bookings ) bookings_source_src_10001 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - bookings_source_src_10001.listing_id = listings_latest_src_10004.listing_id + bookings_source_src_10001.listing_id = listings_latest_src_10005.listing_id GROUP BY bookings_source_src_10001.listing_id - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_11 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric__plan0.sql index c9adb7c74a..645ab1ef7a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric__plan0.sql @@ -31,17 +31,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 ) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric__plan0_optimized.sql index 6ce7eb9f16..9eb18c7706 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric__plan0_optimized.sql @@ -10,6 +10,6 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_grain_to_date__plan0.sql index 9c5aac9f71..d56ca5db59 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_grain_to_date__plan0.sql @@ -31,17 +31,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 ) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_grain_to_date__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_grain_to_date__plan0_optimized.sql index 70a814685d..73d6f53157 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_grain_to_date__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_grain_to_date__plan0_optimized.sql @@ -10,6 +10,6 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_ds__plan0.sql index 8a8b927c31..1b8e6aadb0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_ds__plan0.sql @@ -28,17 +28,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 ) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_ds__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_ds__plan0_optimized.sql index a852f552b0..9e3110067e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_ds__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_ds__plan0_optimized.sql @@ -9,4 +9,4 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window__plan0.sql index e460bce945..87e138974d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window__plan0.sql @@ -31,17 +31,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 ) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window__plan0_optimized.sql index 870ee251a6..b1dd9cac86 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window__plan0_optimized.sql @@ -10,6 +10,6 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 72136f3a44..7cc39c259f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -46,17 +46,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 WHERE subq_1.metric_time BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql index 53bd8842bd..7ca3598979 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql @@ -11,7 +11,7 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 WHERE created_at BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_with_time_constraint__plan0.sql index fa6672724b..8e7bbd8c93 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_with_time_constraint__plan0.sql @@ -46,17 +46,17 @@ FROM ( FROM ( -- Read Elements From Data Source 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , revenue_src_10006.created_at AS ds - , DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , revenue_src_10006.user_id AS user + revenue_src_10007.revenue AS txn_revenue + , revenue_src_10007.created_at AS ds + , DATE_TRUNC('week', revenue_src_10007.created_at) AS ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS ds__year + , revenue_src_10007.user_id AS user FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue - ) revenue_src_10006 + ) revenue_src_10007 ) subq_0 ) subq_1 WHERE subq_1.metric_time BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_with_time_constraint__plan0_optimized.sql index 5e6e5237f3..3769f1c4fe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_cumulative_metric_with_time_constraint__plan0_optimized.sql @@ -11,7 +11,7 @@ SELECT FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_revenue -) revenue_src_10006 +) revenue_src_10007 WHERE created_at BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_distinct_values__plan0.sql index 5942f21287..f4dec3f7ad 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_distinct_values__plan0.sql @@ -207,38 +207,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_3 ) subq_4 ) subq_5 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_distinct_values__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_distinct_values__plan0_optimized.sql index c479c10486..c2ffa7198c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_distinct_values__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_distinct_values__plan0_optimized.sql @@ -7,16 +7,16 @@ -- ['listing__country_latest'] -- Order By ['listing__country_latest'] Limit 100 SELECT - listings_latest_src_10004.country AS listing__country_latest + listings_latest_src_10005.country AS listing__country_latest FROM ( -- User Defined SQL Query SELECT * FROM ***************************.fct_bookings ) bookings_source_src_10001 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - bookings_source_src_10001.listing_id = listings_latest_src_10004.listing_id + bookings_source_src_10001.listing_id = listings_latest_src_10005.listing_id GROUP BY - listings_latest_src_10004.country + listings_latest_src_10005.country ORDER BY listing__country_latest LIMIT 100 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_filter_with_where_constraint_on_join_dim__plan0.sql index 7300f23440..2d2c5426b2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -213,38 +213,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_3 ) subq_4 ) subq_5 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql index c5a1407424..40d9edad54 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql @@ -12,7 +12,7 @@ FROM ( -- ['bookings', 'is_instant', 'listing__country_latest'] SELECT subq_13.is_instant AS is_instant - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , subq_13.bookings AS bookings FROM ( -- Read Elements From Data Source 'bookings_source' @@ -29,9 +29,9 @@ FROM ( ) bookings_source_src_10001 ) subq_13 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_13.listing = listings_latest_src_10004.listing_id + subq_13.listing = listings_latest_src_10005.listing_id ) subq_18 WHERE listing__country_latest = 'us' GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_conversion_events_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_conversion_events_node__plan0.sql new file mode 100644 index 0000000000..0adbd569fc --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_conversion_events_node__plan0.sql @@ -0,0 +1,83 @@ +-- Find conversions for IdentifierSpec(element_name='user', identifier_links=()) within the range of 7 day +SELECT + subq_3.ds + , subq_3.ds__week + , subq_3.ds__month + , subq_3.ds__quarter + , subq_3.ds__year + , subq_3.user + , subq_3.referrer_id + , subq_3.buys + , subq_3.visits + , subq_3.visitors +FROM ( + -- Dedupe the fanout on (MetadataSpec(element_name='mf_internal_uuid'),) in the conversion data set + SELECT DISTINCT + first_value(subq_0.visits) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS visits + , first_value(subq_0.visitors) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS visitors + , first_value(subq_0.referrer_id) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS referrer_id + , first_value(subq_0.ds) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS ds + , first_value(subq_0.ds__week) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS ds__week + , first_value(subq_0.ds__month) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS ds__month + , first_value(subq_0.ds__quarter) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS ds__quarter + , first_value(subq_0.ds__year) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS ds__year + , first_value(subq_0.user) OVER (PARTITION BY subq_2.user, subq_2.ds ORDER BY subq_0.ds DESC) AS user + , subq_2.mf_internal_uuid AS mf_internal_uuid + , subq_2.buys AS buys + FROM ( + -- Read Elements From Data Source 'visits_source' + SELECT + 1 AS visits + , visits_source_src_10011.user_id AS visitors + , visits_source_src_10011.ds + , DATE_TRUNC('week', visits_source_src_10011.ds) AS ds__week + , DATE_TRUNC('month', visits_source_src_10011.ds) AS ds__month + , DATE_TRUNC('quarter', visits_source_src_10011.ds) AS ds__quarter + , DATE_TRUNC('year', visits_source_src_10011.ds) AS ds__year + , visits_source_src_10011.referrer_id + , visits_source_src_10011.user_id AS user + FROM ( + -- User Defined SQL Query + SELECT * FROM ***************************.fct_visits + ) visits_source_src_10011 + ) subq_0 + INNER JOIN ( + -- Add column with generated UUID + SELECT + subq_1.ds + , subq_1.ds__week + , subq_1.ds__month + , subq_1.ds__quarter + , subq_1.ds__year + , subq_1.user + , subq_1.buys + , subq_1.buyers + , GEN_RANDOM_UUID() AS mf_internal_uuid + FROM ( + -- Read Elements From Data Source 'buys_source' + SELECT + 1 AS buys + , buys_source_src_10002.user_id AS buyers + , buys_source_src_10002.ds + , DATE_TRUNC('week', buys_source_src_10002.ds) AS ds__week + , DATE_TRUNC('month', buys_source_src_10002.ds) AS ds__month + , DATE_TRUNC('quarter', buys_source_src_10002.ds) AS ds__quarter + , DATE_TRUNC('year', buys_source_src_10002.ds) AS ds__year + , buys_source_src_10002.user_id AS user + FROM ( + -- User Defined SQL Query + SELECT * FROM ***************************.fct_buys + ) buys_source_src_10002 + ) subq_1 + ) subq_2 + ON + ( + subq_0.user = subq_2.user + ) AND ( + ( + subq_0.ds <= subq_2.ds + ) AND ( + subq_0.ds > subq_2.ds - MAKE_INTERVAL(days => 7) + ) + ) +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_conversion_events_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_conversion_events_node__plan0_optimized.sql new file mode 100644 index 0000000000..38bfbaae91 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_conversion_events_node__plan0_optimized.sql @@ -0,0 +1,67 @@ +-- Find conversions for IdentifierSpec(element_name='user', identifier_links=()) within the range of 7 day +SELECT + ds + , ds__week + , ds__month + , ds__quarter + , ds__year + , subq_7.user + , referrer_id + , buys + , visits + , visitors +FROM ( + -- Dedupe the fanout on (MetadataSpec(element_name='mf_internal_uuid'),) in the conversion data set + SELECT DISTINCT + first_value(subq_4.visits) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS visits + , first_value(subq_4.visitors) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS visitors + , first_value(subq_4.referrer_id) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS referrer_id + , first_value(subq_4.ds) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS ds + , first_value(subq_4.ds__week) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS ds__week + , first_value(subq_4.ds__month) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS ds__month + , first_value(subq_4.ds__quarter) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS ds__quarter + , first_value(subq_4.ds__year) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS ds__year + , first_value(subq_4.user) OVER (PARTITION BY subq_6.user, subq_6.ds ORDER BY subq_4.ds DESC) AS user + , subq_6.mf_internal_uuid AS mf_internal_uuid + , subq_6.buys AS buys + FROM ( + -- Read Elements From Data Source 'visits_source' + SELECT + 1 AS visits + , user_id AS visitors + , ds + , DATE_TRUNC('week', ds) AS ds__week + , DATE_TRUNC('month', ds) AS ds__month + , DATE_TRUNC('quarter', ds) AS ds__quarter + , DATE_TRUNC('year', ds) AS ds__year + , referrer_id + , user_id AS user + FROM ( + -- User Defined SQL Query + SELECT * FROM ***************************.fct_visits + ) visits_source_src_10011 + ) subq_4 + INNER JOIN ( + -- Read Elements From Data Source 'buys_source' + -- Add column with generated UUID + SELECT + ds + , user_id AS user + , 1 AS buys + , GEN_RANDOM_UUID() AS mf_internal_uuid + FROM ( + -- User Defined SQL Query + SELECT * FROM ***************************.fct_buys + ) buys_source_src_10002 + ) subq_6 + ON + ( + subq_4.user = subq_6.user + ) AND ( + ( + subq_4.ds <= subq_6.ds + ) AND ( + subq_4.ds > subq_6.ds - MAKE_INTERVAL(days => 7) + ) + ) +) subq_7 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_to_scd_dimension__plan0.sql index b2b573ee8e..e4f5ea6fc5 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_to_scd_dimension__plan0.sql @@ -80,31 +80,31 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10018.booking_value - , bookings_source_src_10018.guest_id AS bookers - , bookings_source_src_10018.booking_value AS average_booking_value - , bookings_source_src_10018.booking_value AS booking_payments - , bookings_source_src_10018.is_instant - , bookings_source_src_10018.ds - , DATE_TRUNC('week', bookings_source_src_10018.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10018.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds) AS ds__year - , bookings_source_src_10018.ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__year - , bookings_source_src_10018.booking_paid_at - , DATE_TRUNC('week', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__week - , DATE_TRUNC('month', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__year - , bookings_source_src_10018.listing_id AS listing - , bookings_source_src_10018.guest_id AS guest - , bookings_source_src_10018.host_id AS host - , bookings_source_src_10018.guest_id AS user - FROM ***************************.fct_bookings bookings_source_src_10018 + , bookings_source_src_10020.booking_value + , bookings_source_src_10020.guest_id AS bookers + , bookings_source_src_10020.booking_value AS average_booking_value + , bookings_source_src_10020.booking_value AS booking_payments + , bookings_source_src_10020.is_instant + , bookings_source_src_10020.ds + , DATE_TRUNC('week', bookings_source_src_10020.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10020.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds) AS ds__year + , bookings_source_src_10020.ds_partitioned + , DATE_TRUNC('week', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__year + , bookings_source_src_10020.booking_paid_at + , DATE_TRUNC('week', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__week + , DATE_TRUNC('month', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__year + , bookings_source_src_10020.listing_id AS listing + , bookings_source_src_10020.guest_id AS guest + , bookings_source_src_10020.host_id AS host + , bookings_source_src_10020.guest_id AS user + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_0 ) subq_1 ) subq_2 @@ -119,36 +119,36 @@ FROM ( FROM ( -- Read Elements From Data Source 'listings' SELECT - listings_src_10020.active_from AS window_start - , DATE_TRUNC('week', listings_src_10020.active_from) AS window_start__week - , DATE_TRUNC('month', listings_src_10020.active_from) AS window_start__month - , DATE_TRUNC('quarter', listings_src_10020.active_from) AS window_start__quarter - , DATE_TRUNC('year', listings_src_10020.active_from) AS window_start__year - , listings_src_10020.active_to AS window_end - , DATE_TRUNC('week', listings_src_10020.active_to) AS window_end__week - , DATE_TRUNC('month', listings_src_10020.active_to) AS window_end__month - , DATE_TRUNC('quarter', listings_src_10020.active_to) AS window_end__quarter - , DATE_TRUNC('year', listings_src_10020.active_to) AS window_end__year - , listings_src_10020.country - , listings_src_10020.is_lux - , listings_src_10020.capacity - , listings_src_10020.active_from AS listing__window_start - , DATE_TRUNC('week', listings_src_10020.active_from) AS listing__window_start__week - , DATE_TRUNC('month', listings_src_10020.active_from) AS listing__window_start__month - , DATE_TRUNC('quarter', listings_src_10020.active_from) AS listing__window_start__quarter - , DATE_TRUNC('year', listings_src_10020.active_from) AS listing__window_start__year - , listings_src_10020.active_to AS listing__window_end - , DATE_TRUNC('week', listings_src_10020.active_to) AS listing__window_end__week - , DATE_TRUNC('month', listings_src_10020.active_to) AS listing__window_end__month - , DATE_TRUNC('quarter', listings_src_10020.active_to) AS listing__window_end__quarter - , DATE_TRUNC('year', listings_src_10020.active_to) AS listing__window_end__year - , listings_src_10020.country AS listing__country - , listings_src_10020.is_lux AS listing__is_lux - , listings_src_10020.capacity AS listing__capacity - , listings_src_10020.listing_id AS listing - , listings_src_10020.user_id AS user - , listings_src_10020.user_id AS listing__user - FROM ***************************.dim_listings listings_src_10020 + listings_src_10022.active_from AS window_start + , DATE_TRUNC('week', listings_src_10022.active_from) AS window_start__week + , DATE_TRUNC('month', listings_src_10022.active_from) AS window_start__month + , DATE_TRUNC('quarter', listings_src_10022.active_from) AS window_start__quarter + , DATE_TRUNC('year', listings_src_10022.active_from) AS window_start__year + , listings_src_10022.active_to AS window_end + , DATE_TRUNC('week', listings_src_10022.active_to) AS window_end__week + , DATE_TRUNC('month', listings_src_10022.active_to) AS window_end__month + , DATE_TRUNC('quarter', listings_src_10022.active_to) AS window_end__quarter + , DATE_TRUNC('year', listings_src_10022.active_to) AS window_end__year + , listings_src_10022.country + , listings_src_10022.is_lux + , listings_src_10022.capacity + , listings_src_10022.active_from AS listing__window_start + , DATE_TRUNC('week', listings_src_10022.active_from) AS listing__window_start__week + , DATE_TRUNC('month', listings_src_10022.active_from) AS listing__window_start__month + , DATE_TRUNC('quarter', listings_src_10022.active_from) AS listing__window_start__quarter + , DATE_TRUNC('year', listings_src_10022.active_from) AS listing__window_start__year + , listings_src_10022.active_to AS listing__window_end + , DATE_TRUNC('week', listings_src_10022.active_to) AS listing__window_end__week + , DATE_TRUNC('month', listings_src_10022.active_to) AS listing__window_end__month + , DATE_TRUNC('quarter', listings_src_10022.active_to) AS listing__window_end__quarter + , DATE_TRUNC('year', listings_src_10022.active_to) AS listing__window_end__year + , listings_src_10022.country AS listing__country + , listings_src_10022.is_lux AS listing__is_lux + , listings_src_10022.capacity AS listing__capacity + , listings_src_10022.listing_id AS listing + , listings_src_10022.user_id AS user + , listings_src_10022.user_id AS listing__user + FROM ***************************.dim_listings listings_src_10022 ) subq_3 ) subq_4 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_to_scd_dimension__plan0_optimized.sql index 806ee6523a..fc9c6b0586 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_join_to_scd_dimension__plan0_optimized.sql @@ -12,7 +12,7 @@ FROM ( -- ['bookings', 'listing__capacity', 'metric_time'] SELECT subq_12.metric_time AS metric_time - , listings_src_10020.capacity AS listing__capacity + , listings_src_10022.capacity AS listing__capacity , subq_12.bookings AS bookings FROM ( -- Read Elements From Data Source 'bookings_source' @@ -23,21 +23,21 @@ FROM ( ds AS metric_time , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10018 + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_12 LEFT OUTER JOIN - ***************************.dim_listings listings_src_10020 + ***************************.dim_listings listings_src_10022 ON ( - subq_12.listing = listings_src_10020.listing_id + subq_12.listing = listings_src_10022.listing_id ) AND ( ( - subq_12.metric_time >= listings_src_10020.active_from + subq_12.metric_time >= listings_src_10022.active_from ) AND ( ( - subq_12.metric_time < listings_src_10020.active_to + subq_12.metric_time < listings_src_10022.active_to ) OR ( - listings_src_10020.active_to IS NULL + listings_src_10022.active_to IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0.sql index 2e7ec02d12..7f12ee4a3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0.sql @@ -57,38 +57,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql index 3c0f240434..5182b302e3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql @@ -11,7 +11,7 @@ FROM ( SELECT country AS listing__country_latest , 1 AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_6 GROUP BY listing__country_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_measure_constraint__plan0.sql index 29b5d02967..5d7a250860 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_measure_constraint__plan0.sql @@ -234,38 +234,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_3 ) subq_4 ) subq_5 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_measure_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_measure_constraint__plan0_optimized.sql index b4163117c1..73e0f36a00 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_measure_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_measure_constraint__plan0_optimized.sql @@ -26,7 +26,7 @@ FROM ( -- ['average_booking_value', 'bookings', 'listing__is_lux_latest', 'metric_time'] SELECT subq_19.metric_time AS metric_time - , listings_latest_src_10004.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest , subq_19.bookings AS bookings , subq_19.average_booking_value AS average_booking_value FROM ( @@ -45,9 +45,9 @@ FROM ( ) bookings_source_src_10001 ) subq_19 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_19.listing = listings_latest_src_10004.listing_id + subq_19.listing = listings_latest_src_10005.listing_id ) subq_24 WHERE listing__is_lux_latest GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 682da44752..b96b30de79 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -198,38 +198,38 @@ FROM ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_4 ) subq_5 ) subq_6 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql index c1d493f8f3..296cedaaec 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql @@ -25,5 +25,5 @@ CROSS JOIN ( -- Aggregate Measures SELECT SUM(1) AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_17 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_through_scd_dimension__plan0.sql index de96078445..7a7dcfbc29 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_through_scd_dimension__plan0.sql @@ -70,31 +70,31 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10018.booking_value - , bookings_source_src_10018.guest_id AS bookers - , bookings_source_src_10018.booking_value AS average_booking_value - , bookings_source_src_10018.booking_value AS booking_payments - , bookings_source_src_10018.is_instant - , bookings_source_src_10018.ds - , DATE_TRUNC('week', bookings_source_src_10018.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10018.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds) AS ds__year - , bookings_source_src_10018.ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__year - , bookings_source_src_10018.booking_paid_at - , DATE_TRUNC('week', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__week - , DATE_TRUNC('month', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__year - , bookings_source_src_10018.listing_id AS listing - , bookings_source_src_10018.guest_id AS guest - , bookings_source_src_10018.host_id AS host - , bookings_source_src_10018.guest_id AS user - FROM ***************************.fct_bookings bookings_source_src_10018 + , bookings_source_src_10020.booking_value + , bookings_source_src_10020.guest_id AS bookers + , bookings_source_src_10020.booking_value AS average_booking_value + , bookings_source_src_10020.booking_value AS booking_payments + , bookings_source_src_10020.is_instant + , bookings_source_src_10020.ds + , DATE_TRUNC('week', bookings_source_src_10020.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10020.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds) AS ds__year + , bookings_source_src_10020.ds_partitioned + , DATE_TRUNC('week', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__year + , bookings_source_src_10020.booking_paid_at + , DATE_TRUNC('week', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__week + , DATE_TRUNC('month', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__year + , bookings_source_src_10020.listing_id AS listing + , bookings_source_src_10020.guest_id AS guest + , bookings_source_src_10020.host_id AS host + , bookings_source_src_10020.guest_id AS user + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_0 ) subq_1 ) subq_2 @@ -147,36 +147,36 @@ FROM ( FROM ( -- Read Elements From Data Source 'listings' SELECT - listings_src_10020.active_from AS window_start - , DATE_TRUNC('week', listings_src_10020.active_from) AS window_start__week - , DATE_TRUNC('month', listings_src_10020.active_from) AS window_start__month - , DATE_TRUNC('quarter', listings_src_10020.active_from) AS window_start__quarter - , DATE_TRUNC('year', listings_src_10020.active_from) AS window_start__year - , listings_src_10020.active_to AS window_end - , DATE_TRUNC('week', listings_src_10020.active_to) AS window_end__week - , DATE_TRUNC('month', listings_src_10020.active_to) AS window_end__month - , DATE_TRUNC('quarter', listings_src_10020.active_to) AS window_end__quarter - , DATE_TRUNC('year', listings_src_10020.active_to) AS window_end__year - , listings_src_10020.country - , listings_src_10020.is_lux - , listings_src_10020.capacity - , listings_src_10020.active_from AS listing__window_start - , DATE_TRUNC('week', listings_src_10020.active_from) AS listing__window_start__week - , DATE_TRUNC('month', listings_src_10020.active_from) AS listing__window_start__month - , DATE_TRUNC('quarter', listings_src_10020.active_from) AS listing__window_start__quarter - , DATE_TRUNC('year', listings_src_10020.active_from) AS listing__window_start__year - , listings_src_10020.active_to AS listing__window_end - , DATE_TRUNC('week', listings_src_10020.active_to) AS listing__window_end__week - , DATE_TRUNC('month', listings_src_10020.active_to) AS listing__window_end__month - , DATE_TRUNC('quarter', listings_src_10020.active_to) AS listing__window_end__quarter - , DATE_TRUNC('year', listings_src_10020.active_to) AS listing__window_end__year - , listings_src_10020.country AS listing__country - , listings_src_10020.is_lux AS listing__is_lux - , listings_src_10020.capacity AS listing__capacity - , listings_src_10020.listing_id AS listing - , listings_src_10020.user_id AS user - , listings_src_10020.user_id AS listing__user - FROM ***************************.dim_listings listings_src_10020 + listings_src_10022.active_from AS window_start + , DATE_TRUNC('week', listings_src_10022.active_from) AS window_start__week + , DATE_TRUNC('month', listings_src_10022.active_from) AS window_start__month + , DATE_TRUNC('quarter', listings_src_10022.active_from) AS window_start__quarter + , DATE_TRUNC('year', listings_src_10022.active_from) AS window_start__year + , listings_src_10022.active_to AS window_end + , DATE_TRUNC('week', listings_src_10022.active_to) AS window_end__week + , DATE_TRUNC('month', listings_src_10022.active_to) AS window_end__month + , DATE_TRUNC('quarter', listings_src_10022.active_to) AS window_end__quarter + , DATE_TRUNC('year', listings_src_10022.active_to) AS window_end__year + , listings_src_10022.country + , listings_src_10022.is_lux + , listings_src_10022.capacity + , listings_src_10022.active_from AS listing__window_start + , DATE_TRUNC('week', listings_src_10022.active_from) AS listing__window_start__week + , DATE_TRUNC('month', listings_src_10022.active_from) AS listing__window_start__month + , DATE_TRUNC('quarter', listings_src_10022.active_from) AS listing__window_start__quarter + , DATE_TRUNC('year', listings_src_10022.active_from) AS listing__window_start__year + , listings_src_10022.active_to AS listing__window_end + , DATE_TRUNC('week', listings_src_10022.active_to) AS listing__window_end__week + , DATE_TRUNC('month', listings_src_10022.active_to) AS listing__window_end__month + , DATE_TRUNC('quarter', listings_src_10022.active_to) AS listing__window_end__quarter + , DATE_TRUNC('year', listings_src_10022.active_to) AS listing__window_end__year + , listings_src_10022.country AS listing__country + , listings_src_10022.is_lux AS listing__is_lux + , listings_src_10022.capacity AS listing__capacity + , listings_src_10022.listing_id AS listing + , listings_src_10022.user_id AS user + , listings_src_10022.user_id AS listing__user + FROM ***************************.dim_listings listings_src_10022 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -210,20 +210,20 @@ FROM ( FROM ( -- Read Elements From Data Source 'users_latest' SELECT - users_latest_src_10024.ds - , DATE_TRUNC('week', users_latest_src_10024.ds) AS ds__week - , DATE_TRUNC('month', users_latest_src_10024.ds) AS ds__month - , DATE_TRUNC('quarter', users_latest_src_10024.ds) AS ds__quarter - , DATE_TRUNC('year', users_latest_src_10024.ds) AS ds__year - , users_latest_src_10024.home_state_latest - , users_latest_src_10024.ds AS user__ds - , DATE_TRUNC('week', users_latest_src_10024.ds) AS user__ds__week - , DATE_TRUNC('month', users_latest_src_10024.ds) AS user__ds__month - , DATE_TRUNC('quarter', users_latest_src_10024.ds) AS user__ds__quarter - , DATE_TRUNC('year', users_latest_src_10024.ds) AS user__ds__year - , users_latest_src_10024.home_state_latest AS user__home_state_latest - , users_latest_src_10024.user_id AS user - FROM ***************************.dim_users_latest users_latest_src_10024 + users_latest_src_10026.ds + , DATE_TRUNC('week', users_latest_src_10026.ds) AS ds__week + , DATE_TRUNC('month', users_latest_src_10026.ds) AS ds__month + , DATE_TRUNC('quarter', users_latest_src_10026.ds) AS ds__quarter + , DATE_TRUNC('year', users_latest_src_10026.ds) AS ds__year + , users_latest_src_10026.home_state_latest + , users_latest_src_10026.ds AS user__ds + , DATE_TRUNC('week', users_latest_src_10026.ds) AS user__ds__week + , DATE_TRUNC('month', users_latest_src_10026.ds) AS user__ds__month + , DATE_TRUNC('quarter', users_latest_src_10026.ds) AS user__ds__quarter + , DATE_TRUNC('year', users_latest_src_10026.ds) AS user__ds__year + , users_latest_src_10026.home_state_latest AS user__home_state_latest + , users_latest_src_10026.user_id AS user + FROM ***************************.dim_users_latest users_latest_src_10026 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_through_scd_dimension__plan0_optimized.sql index 61eae48b58..db5c297049 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -16,22 +16,22 @@ FROM ( ds AS metric_time , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10018 + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_13 LEFT OUTER JOIN ( -- Join Standard Outputs -- Pass Only Elements: -- ['user__home_state_latest', 'window_start', 'window_end', 'listing'] SELECT - listings_src_10020.active_from AS window_start - , listings_src_10020.active_to AS window_end - , listings_src_10020.listing_id AS listing - , users_latest_src_10024.home_state_latest AS user__home_state_latest - FROM ***************************.dim_listings listings_src_10020 + listings_src_10022.active_from AS window_start + , listings_src_10022.active_to AS window_end + , listings_src_10022.listing_id AS listing + , users_latest_src_10026.home_state_latest AS user__home_state_latest + FROM ***************************.dim_listings listings_src_10022 LEFT OUTER JOIN - ***************************.dim_users_latest users_latest_src_10024 + ***************************.dim_users_latest users_latest_src_10026 ON - listings_src_10020.user_id = users_latest_src_10024.user_id + listings_src_10022.user_id = users_latest_src_10026.user_id ) subq_18 ON ( diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_to_scd_dimension__plan0.sql index f517949c7d..066f02057d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_to_scd_dimension__plan0.sql @@ -70,31 +70,31 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10018.booking_value - , bookings_source_src_10018.guest_id AS bookers - , bookings_source_src_10018.booking_value AS average_booking_value - , bookings_source_src_10018.booking_value AS booking_payments - , bookings_source_src_10018.is_instant - , bookings_source_src_10018.ds - , DATE_TRUNC('week', bookings_source_src_10018.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10018.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds) AS ds__year - , bookings_source_src_10018.ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10018.ds_partitioned) AS ds_partitioned__year - , bookings_source_src_10018.booking_paid_at - , DATE_TRUNC('week', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__week - , DATE_TRUNC('month', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10018.booking_paid_at) AS booking_paid_at__year - , bookings_source_src_10018.listing_id AS listing - , bookings_source_src_10018.guest_id AS guest - , bookings_source_src_10018.host_id AS host - , bookings_source_src_10018.guest_id AS user - FROM ***************************.fct_bookings bookings_source_src_10018 + , bookings_source_src_10020.booking_value + , bookings_source_src_10020.guest_id AS bookers + , bookings_source_src_10020.booking_value AS average_booking_value + , bookings_source_src_10020.booking_value AS booking_payments + , bookings_source_src_10020.is_instant + , bookings_source_src_10020.ds + , DATE_TRUNC('week', bookings_source_src_10020.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10020.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds) AS ds__year + , bookings_source_src_10020.ds_partitioned + , DATE_TRUNC('week', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10020.ds_partitioned) AS ds_partitioned__year + , bookings_source_src_10020.booking_paid_at + , DATE_TRUNC('week', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__week + , DATE_TRUNC('month', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10020.booking_paid_at) AS booking_paid_at__year + , bookings_source_src_10020.listing_id AS listing + , bookings_source_src_10020.guest_id AS guest + , bookings_source_src_10020.host_id AS host + , bookings_source_src_10020.guest_id AS user + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_0 ) subq_1 ) subq_2 @@ -129,10 +129,10 @@ FROM ( FROM ( -- Read Elements From Data Source 'lux_listing_mapping' SELECT - lux_listing_mapping_src_10021.listing_id AS listing - , lux_listing_mapping_src_10021.lux_listing_id AS lux_listing - , lux_listing_mapping_src_10021.lux_listing_id AS listing__lux_listing - FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10021 + lux_listing_mapping_src_10023.listing_id AS listing + , lux_listing_mapping_src_10023.lux_listing_id AS lux_listing + , lux_listing_mapping_src_10023.lux_listing_id AS listing__lux_listing + FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10023 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -186,30 +186,30 @@ FROM ( FROM ( -- Read Elements From Data Source 'lux_listings' SELECT - lux_listings_src_10022.valid_from AS window_start - , DATE_TRUNC('week', lux_listings_src_10022.valid_from) AS window_start__week - , DATE_TRUNC('month', lux_listings_src_10022.valid_from) AS window_start__month - , DATE_TRUNC('quarter', lux_listings_src_10022.valid_from) AS window_start__quarter - , DATE_TRUNC('year', lux_listings_src_10022.valid_from) AS window_start__year - , lux_listings_src_10022.valid_to AS window_end - , DATE_TRUNC('week', lux_listings_src_10022.valid_to) AS window_end__week - , DATE_TRUNC('month', lux_listings_src_10022.valid_to) AS window_end__month - , DATE_TRUNC('quarter', lux_listings_src_10022.valid_to) AS window_end__quarter - , DATE_TRUNC('year', lux_listings_src_10022.valid_to) AS window_end__year - , lux_listings_src_10022.is_confirmed_lux - , lux_listings_src_10022.valid_from AS lux_listing__window_start - , DATE_TRUNC('week', lux_listings_src_10022.valid_from) AS lux_listing__window_start__week - , DATE_TRUNC('month', lux_listings_src_10022.valid_from) AS lux_listing__window_start__month - , DATE_TRUNC('quarter', lux_listings_src_10022.valid_from) AS lux_listing__window_start__quarter - , DATE_TRUNC('year', lux_listings_src_10022.valid_from) AS lux_listing__window_start__year - , lux_listings_src_10022.valid_to AS lux_listing__window_end - , DATE_TRUNC('week', lux_listings_src_10022.valid_to) AS lux_listing__window_end__week - , DATE_TRUNC('month', lux_listings_src_10022.valid_to) AS lux_listing__window_end__month - , DATE_TRUNC('quarter', lux_listings_src_10022.valid_to) AS lux_listing__window_end__quarter - , DATE_TRUNC('year', lux_listings_src_10022.valid_to) AS lux_listing__window_end__year - , lux_listings_src_10022.is_confirmed_lux AS lux_listing__is_confirmed_lux - , lux_listings_src_10022.lux_listing_id AS lux_listing - FROM ***************************.dim_lux_listings lux_listings_src_10022 + lux_listings_src_10024.valid_from AS window_start + , DATE_TRUNC('week', lux_listings_src_10024.valid_from) AS window_start__week + , DATE_TRUNC('month', lux_listings_src_10024.valid_from) AS window_start__month + , DATE_TRUNC('quarter', lux_listings_src_10024.valid_from) AS window_start__quarter + , DATE_TRUNC('year', lux_listings_src_10024.valid_from) AS window_start__year + , lux_listings_src_10024.valid_to AS window_end + , DATE_TRUNC('week', lux_listings_src_10024.valid_to) AS window_end__week + , DATE_TRUNC('month', lux_listings_src_10024.valid_to) AS window_end__month + , DATE_TRUNC('quarter', lux_listings_src_10024.valid_to) AS window_end__quarter + , DATE_TRUNC('year', lux_listings_src_10024.valid_to) AS window_end__year + , lux_listings_src_10024.is_confirmed_lux + , lux_listings_src_10024.valid_from AS lux_listing__window_start + , DATE_TRUNC('week', lux_listings_src_10024.valid_from) AS lux_listing__window_start__week + , DATE_TRUNC('month', lux_listings_src_10024.valid_from) AS lux_listing__window_start__month + , DATE_TRUNC('quarter', lux_listings_src_10024.valid_from) AS lux_listing__window_start__quarter + , DATE_TRUNC('year', lux_listings_src_10024.valid_from) AS lux_listing__window_start__year + , lux_listings_src_10024.valid_to AS lux_listing__window_end + , DATE_TRUNC('week', lux_listings_src_10024.valid_to) AS lux_listing__window_end__week + , DATE_TRUNC('month', lux_listings_src_10024.valid_to) AS lux_listing__window_end__month + , DATE_TRUNC('quarter', lux_listings_src_10024.valid_to) AS lux_listing__window_end__quarter + , DATE_TRUNC('year', lux_listings_src_10024.valid_to) AS lux_listing__window_end__year + , lux_listings_src_10024.is_confirmed_lux AS lux_listing__is_confirmed_lux + , lux_listings_src_10024.lux_listing_id AS lux_listing + FROM ***************************.dim_lux_listings lux_listings_src_10024 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_to_scd_dimension__plan0_optimized.sql index d7d9f8b842..bdd70cecc4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -16,7 +16,7 @@ FROM ( ds AS metric_time , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10018 + FROM ***************************.fct_bookings bookings_source_src_10020 ) subq_13 LEFT OUTER JOIN ( -- Join Standard Outputs @@ -26,15 +26,15 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end', -- 'listing'] SELECT - lux_listings_src_10022.valid_from AS lux_listing__window_start - , lux_listings_src_10022.valid_to AS lux_listing__window_end - , lux_listing_mapping_src_10021.listing_id AS listing - , lux_listings_src_10022.is_confirmed_lux AS lux_listing__is_confirmed_lux - FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10021 + lux_listings_src_10024.valid_from AS lux_listing__window_start + , lux_listings_src_10024.valid_to AS lux_listing__window_end + , lux_listing_mapping_src_10023.listing_id AS listing + , lux_listings_src_10024.is_confirmed_lux AS lux_listing__is_confirmed_lux + FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10023 LEFT OUTER JOIN - ***************************.dim_lux_listings lux_listings_src_10022 + ***************************.dim_lux_listings lux_listings_src_10024 ON - lux_listing_mapping_src_10021.lux_listing_id = lux_listings_src_10022.lux_listing_id + lux_listing_mapping_src_10023.lux_listing_id = lux_listings_src_10024.lux_listing_id ) subq_18 ON ( diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_join_node__plan0.sql index b853ede081..aab559dc28 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_join_node__plan0.sql @@ -82,38 +82,38 @@ LEFT OUTER JOIN ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_2 ) subq_3 ON @@ -128,38 +128,38 @@ LEFT OUTER JOIN ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_join_node__plan0_optimized.sql index 1093bb0b49..b9b3110aab 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multi_join_node__plan0_optimized.sql @@ -23,7 +23,7 @@ LEFT OUTER JOIN ( SELECT listing_id AS listing , country AS country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_9 ON subq_7.listing = subq_9.listing @@ -34,7 +34,7 @@ LEFT OUTER JOIN ( SELECT listing_id AS listing , country AS country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_11 ON subq_7.listing = subq_11.listing diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multihop_node__plan0.sql index eb170aa5f4..58aa9d73cf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multihop_node__plan0.sql @@ -63,31 +63,31 @@ FROM ( FROM ( -- Read Elements From Data Source 'account_month_txns' SELECT - account_month_txns_src_10010.txn_count - , account_month_txns_src_10010.ds_partitioned - , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year - , account_month_txns_src_10010.ds - , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week - , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month - , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter - , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year - , account_month_txns_src_10010.account_month - , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned - , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week - , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month - , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter - , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year - , account_month_txns_src_10010.ds AS account_id__ds - , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week - , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month - , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter - , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year - , account_month_txns_src_10010.account_month AS account_id__account_month - , account_month_txns_src_10010.account_id - FROM ***************************.account_month_txns account_month_txns_src_10010 + account_month_txns_src_10012.txn_count + , account_month_txns_src_10012.ds_partitioned + , DATE_TRUNC('week', account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__year + , account_month_txns_src_10012.ds + , DATE_TRUNC('week', account_month_txns_src_10012.ds) AS ds__week + , DATE_TRUNC('month', account_month_txns_src_10012.ds) AS ds__month + , DATE_TRUNC('quarter', account_month_txns_src_10012.ds) AS ds__quarter + , DATE_TRUNC('year', account_month_txns_src_10012.ds) AS ds__year + , account_month_txns_src_10012.account_month + , account_month_txns_src_10012.ds_partitioned AS account_id__ds_partitioned + , DATE_TRUNC('week', account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__week + , DATE_TRUNC('month', account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__month + , DATE_TRUNC('quarter', account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__quarter + , DATE_TRUNC('year', account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__year + , account_month_txns_src_10012.ds AS account_id__ds + , DATE_TRUNC('week', account_month_txns_src_10012.ds) AS account_id__ds__week + , DATE_TRUNC('month', account_month_txns_src_10012.ds) AS account_id__ds__month + , DATE_TRUNC('quarter', account_month_txns_src_10012.ds) AS account_id__ds__quarter + , DATE_TRUNC('year', account_month_txns_src_10012.ds) AS account_id__ds__year + , account_month_txns_src_10012.account_month AS account_id__account_month + , account_month_txns_src_10012.account_id + FROM ***************************.account_month_txns account_month_txns_src_10012 ) subq_0 ) subq_1 ) subq_2 @@ -126,22 +126,22 @@ FROM ( FROM ( -- Read Elements From Data Source 'bridge_table' SELECT - bridge_table_src_10011.extra_dim - , bridge_table_src_10011.ds_partitioned - , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year - , bridge_table_src_10011.extra_dim AS account_id__extra_dim - , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned - , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week - , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month - , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter - , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year - , bridge_table_src_10011.account_id - , bridge_table_src_10011.customer_id - , bridge_table_src_10011.customer_id AS account_id__customer_id - FROM ***************************.bridge_table bridge_table_src_10011 + bridge_table_src_10013.extra_dim + , bridge_table_src_10013.ds_partitioned + , DATE_TRUNC('week', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__year + , bridge_table_src_10013.extra_dim AS account_id__extra_dim + , bridge_table_src_10013.ds_partitioned AS account_id__ds_partitioned + , DATE_TRUNC('week', bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__week + , DATE_TRUNC('month', bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__month + , DATE_TRUNC('quarter', bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__quarter + , DATE_TRUNC('year', bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__year + , bridge_table_src_10013.account_id + , bridge_table_src_10013.customer_id + , bridge_table_src_10013.customer_id AS account_id__customer_id + FROM ***************************.bridge_table bridge_table_src_10013 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -179,22 +179,22 @@ FROM ( FROM ( -- Read Elements From Data Source 'customer_table' SELECT - customer_table_src_10013.customer_name - , customer_table_src_10013.customer_atomic_weight - , customer_table_src_10013.ds_partitioned - , DATE_TRUNC('week', customer_table_src_10013.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year - , customer_table_src_10013.customer_name AS customer_id__customer_name - , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight - , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned - , DATE_TRUNC('week', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__week - , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month - , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter - , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year - , customer_table_src_10013.customer_id - FROM ***************************.customer_table customer_table_src_10013 + customer_table_src_10015.customer_name + , customer_table_src_10015.customer_atomic_weight + , customer_table_src_10015.ds_partitioned + , DATE_TRUNC('week', customer_table_src_10015.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', customer_table_src_10015.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', customer_table_src_10015.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', customer_table_src_10015.ds_partitioned) AS ds_partitioned__year + , customer_table_src_10015.customer_name AS customer_id__customer_name + , customer_table_src_10015.customer_atomic_weight AS customer_id__customer_atomic_weight + , customer_table_src_10015.ds_partitioned AS customer_id__ds_partitioned + , DATE_TRUNC('week', customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__week + , DATE_TRUNC('month', customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__month + , DATE_TRUNC('quarter', customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__quarter + , DATE_TRUNC('year', customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__year + , customer_table_src_10015.customer_id + FROM ***************************.customer_table customer_table_src_10015 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multihop_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multihop_node__plan0_optimized.sql index 1bd003f415..d64e2a881b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multihop_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multihop_node__plan0_optimized.sql @@ -5,31 +5,31 @@ -- Compute Metrics via Expressions SELECT subq_18.customer_id__customer_name AS account_id__customer_id__customer_name - , SUM(account_month_txns_src_10010.txn_count) AS txn_count -FROM ***************************.account_month_txns account_month_txns_src_10010 + , SUM(account_month_txns_src_10012.txn_count) AS txn_count +FROM ***************************.account_month_txns account_month_txns_src_10012 LEFT OUTER JOIN ( -- Join Standard Outputs -- Pass Only Elements: -- ['customer_id__customer_name', 'ds_partitioned', 'account_id'] SELECT - bridge_table_src_10011.ds_partitioned AS ds_partitioned - , bridge_table_src_10011.account_id AS account_id - , customer_table_src_10013.customer_name AS customer_id__customer_name - FROM ***************************.bridge_table bridge_table_src_10011 + bridge_table_src_10013.ds_partitioned AS ds_partitioned + , bridge_table_src_10013.account_id AS account_id + , customer_table_src_10015.customer_name AS customer_id__customer_name + FROM ***************************.bridge_table bridge_table_src_10013 LEFT OUTER JOIN - ***************************.customer_table customer_table_src_10013 + ***************************.customer_table customer_table_src_10015 ON ( - bridge_table_src_10011.customer_id = customer_table_src_10013.customer_id + bridge_table_src_10013.customer_id = customer_table_src_10015.customer_id ) AND ( - bridge_table_src_10011.ds_partitioned = customer_table_src_10013.ds_partitioned + bridge_table_src_10013.ds_partitioned = customer_table_src_10015.ds_partitioned ) ) subq_18 ON ( - account_month_txns_src_10010.account_id = subq_18.account_id + account_month_txns_src_10012.account_id = subq_18.account_id ) AND ( - account_month_txns_src_10010.ds_partitioned = subq_18.ds_partitioned + account_month_txns_src_10012.ds_partitioned = subq_18.ds_partitioned ) GROUP BY subq_18.customer_id__customer_name diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multiple_metrics_no_dimensions__plan0.sql index 51f635d033..c710a9f5b1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multiple_metrics_no_dimensions__plan0.sql @@ -299,38 +299,38 @@ CROSS JOIN ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_6 ) subq_7 WHERE subq_7.metric_time BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multiple_metrics_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multiple_metrics_no_dimensions__plan0_optimized.sql index 5c3efab0d7..ea6d50b216 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multiple_metrics_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_multiple_metrics_no_dimensions__plan0_optimized.sql @@ -28,6 +28,6 @@ CROSS JOIN ( -- Compute Metrics via Expressions SELECT SUM(1) AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 WHERE created_at BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) ) subq_23 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_partitioned_join__plan0.sql index a664f1546a..8d3716a98c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_partitioned_join__plan0.sql @@ -66,32 +66,32 @@ FROM ( -- Read Elements From Data Source 'id_verifications' SELECT 1 AS identity_verifications - , id_verifications_src_10003.ds - , DATE_TRUNC('week', id_verifications_src_10003.ds) AS ds__week - , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , id_verifications_src_10003.ds_partitioned - , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , id_verifications_src_10003.verification_type - , id_verifications_src_10003.ds AS verification__ds - , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week - , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned - , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week - , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month - , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter - , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , id_verifications_src_10003.verification_type AS verification__verification_type - , id_verifications_src_10003.verification_id AS verification - , id_verifications_src_10003.user_id AS user - , id_verifications_src_10003.user_id AS verification__user - FROM ***************************.fct_id_verifications id_verifications_src_10003 + , id_verifications_src_10004.ds + , DATE_TRUNC('week', id_verifications_src_10004.ds) AS ds__week + , DATE_TRUNC('month', id_verifications_src_10004.ds) AS ds__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds) AS ds__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds) AS ds__year + , id_verifications_src_10004.ds_partitioned + , DATE_TRUNC('week', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__year + , id_verifications_src_10004.verification_type + , id_verifications_src_10004.ds AS verification__ds + , DATE_TRUNC('week', id_verifications_src_10004.ds) AS verification__ds__week + , DATE_TRUNC('month', id_verifications_src_10004.ds) AS verification__ds__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds) AS verification__ds__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds) AS verification__ds__year + , id_verifications_src_10004.ds_partitioned AS verification__ds_partitioned + , DATE_TRUNC('week', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__week + , DATE_TRUNC('month', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__month + , DATE_TRUNC('quarter', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__quarter + , DATE_TRUNC('year', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__year + , id_verifications_src_10004.verification_type AS verification__verification_type + , id_verifications_src_10004.verification_id AS verification + , id_verifications_src_10004.user_id AS user + , id_verifications_src_10004.user_id AS verification__user + FROM ***************************.fct_id_verifications id_verifications_src_10004 ) subq_0 ) subq_1 ) subq_2 @@ -105,40 +105,40 @@ FROM ( FROM ( -- Read Elements From Data Source 'users_ds_source' SELECT - users_ds_source_src_10007.ds - , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS ds__week - , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year - , users_ds_source_src_10007.created_at - , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week - , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year - , users_ds_source_src_10007.ds_partitioned - , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year - , users_ds_source_src_10007.home_state - , users_ds_source_src_10007.ds AS user__ds - , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week - , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year - , users_ds_source_src_10007.created_at AS user__created_at - , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week - , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year - , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned - , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week - , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month - , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter - , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year - , users_ds_source_src_10007.home_state AS user__home_state - , users_ds_source_src_10007.user_id AS user - FROM ***************************.dim_users users_ds_source_src_10007 + users_ds_source_src_10008.ds + , DATE_TRUNC('week', users_ds_source_src_10008.ds) AS ds__week + , DATE_TRUNC('month', users_ds_source_src_10008.ds) AS ds__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.ds) AS ds__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.ds) AS ds__year + , users_ds_source_src_10008.created_at + , DATE_TRUNC('week', users_ds_source_src_10008.created_at) AS created_at__week + , DATE_TRUNC('month', users_ds_source_src_10008.created_at) AS created_at__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.created_at) AS created_at__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.created_at) AS created_at__year + , users_ds_source_src_10008.ds_partitioned + , DATE_TRUNC('week', users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__year + , users_ds_source_src_10008.home_state + , users_ds_source_src_10008.ds AS user__ds + , DATE_TRUNC('week', users_ds_source_src_10008.ds) AS user__ds__week + , DATE_TRUNC('month', users_ds_source_src_10008.ds) AS user__ds__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.ds) AS user__ds__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.ds) AS user__ds__year + , users_ds_source_src_10008.created_at AS user__created_at + , DATE_TRUNC('week', users_ds_source_src_10008.created_at) AS user__created_at__week + , DATE_TRUNC('month', users_ds_source_src_10008.created_at) AS user__created_at__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.created_at) AS user__created_at__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.created_at) AS user__created_at__year + , users_ds_source_src_10008.ds_partitioned AS user__ds_partitioned + , DATE_TRUNC('week', users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__week + , DATE_TRUNC('month', users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__month + , DATE_TRUNC('quarter', users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__quarter + , DATE_TRUNC('year', users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__year + , users_ds_source_src_10008.home_state AS user__home_state + , users_ds_source_src_10008.user_id AS user + FROM ***************************.dim_users users_ds_source_src_10008 ) subq_3 ) subq_4 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_partitioned_join__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_partitioned_join__plan0_optimized.sql index 5820233b25..9b594d5d61 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_partitioned_join__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_partitioned_join__plan0_optimized.sql @@ -4,7 +4,7 @@ -- Aggregate Measures -- Compute Metrics via Expressions SELECT - users_ds_source_src_10007.home_state AS user__home_state + users_ds_source_src_10008.home_state AS user__home_state , SUM(subq_10.identity_verifications) AS identity_verifications FROM ( -- Read Elements From Data Source 'id_verifications' @@ -15,15 +15,15 @@ FROM ( ds_partitioned , user_id AS user , 1 AS identity_verifications - FROM ***************************.fct_id_verifications id_verifications_src_10003 + FROM ***************************.fct_id_verifications id_verifications_src_10004 ) subq_10 LEFT OUTER JOIN - ***************************.dim_users users_ds_source_src_10007 + ***************************.dim_users users_ds_source_src_10008 ON ( - subq_10.user = users_ds_source_src_10007.user_id + subq_10.user = users_ds_source_src_10008.user_id ) AND ( - subq_10.ds_partitioned = users_ds_source_src_10007.ds_partitioned + subq_10.ds_partitioned = users_ds_source_src_10008.ds_partitioned ) GROUP BY - users_ds_source_src_10007.home_state + users_ds_source_src_10008.home_state diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_single_join_node__plan0.sql index 59f0e2fa56..2bb130ac42 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_single_join_node__plan0.sql @@ -81,38 +81,38 @@ LEFT OUTER JOIN ( -- Read Elements From Data Source 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , listings_latest_src_10005.created_at AS ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , listings_latest_src_10005.created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , listings_latest_src_10005.created_at AS listing__ds + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , listings_latest_src_10005.created_at AS listing__created_at + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_2 ) subq_3 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_single_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_single_join_node__plan0_optimized.sql index 3a3acc15c9..9e84b7a7a8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_single_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_single_join_node__plan0_optimized.sql @@ -1,7 +1,7 @@ -- Join Standard Outputs SELECT subq_5.listing AS listing - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , subq_5.bookings AS bookings FROM ( -- Read Elements From Data Source 'bookings_source' @@ -16,6 +16,6 @@ FROM ( ) bookings_source_src_10001 ) subq_5 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_5.listing = listings_latest_src_10004.listing_id + subq_5.listing = listings_latest_src_10005.listing_id diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_data_source__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_data_source__plan0.xml index a883e8da36..55e8928c0a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_data_source__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_data_source__plan0.xml @@ -1,7 +1,7 @@ - + @@ -14,10 +14,10 @@ - + - + @@ -26,284 +26,289 @@ + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -521,6 +526,7 @@ + @@ -532,282 +538,286 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -1025,6 +1035,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier__plan0.xml index b6ef87b9f2..dcf1a7a096 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier__plan0.xml @@ -16,6 +16,7 @@ + @@ -41,6 +42,7 @@ + @@ -60,6 +62,7 @@ + @@ -155,85 +158,87 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier_with_join__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier_with_join__plan0.xml index 9b5a90805f..1b8ee3554f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier_with_join__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier_with_join__plan0.xml @@ -20,6 +20,7 @@ + @@ -53,6 +54,7 @@ + @@ -76,6 +78,7 @@ + @@ -103,6 +106,7 @@ + @@ -122,6 +126,7 @@ + @@ -217,85 +222,87 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -321,185 +328,187 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier_with_order_by__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier_with_order_by__plan0.xml index b29c04dc6a..3df8de8c8a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier_with_order_by__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_composite_identifier_with_order_by__plan0.xml @@ -24,6 +24,7 @@ + @@ -41,6 +42,7 @@ + @@ -66,6 +68,7 @@ + @@ -85,6 +88,7 @@ + @@ -180,85 +184,87 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml index e06604511c..a404cbb2ca 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml @@ -16,6 +16,7 @@ + @@ -41,6 +42,7 @@ + @@ -64,6 +66,7 @@ + @@ -79,6 +82,7 @@ + @@ -296,6 +300,7 @@ + @@ -315,141 +320,143 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.xml index f9c87ff541..aa67c4777c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_data_sources__plan0.xml @@ -1,394 +1,402 @@ - + - + - + - + + - + - + - + - + - + - + + - + - + - + - + - + - + - + + - + - + - + - + - + - + + - + - + - + - + - + + - + - + - + - + - + - + - + + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -606,6 +614,7 @@ + @@ -617,303 +626,306 @@ - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -927,335 +939,341 @@ - + - + - + - + - + - + + - + - + - + - + - + + - + - + - + - + - + - + - + + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + @@ -1264,303 +1282,306 @@ - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_data_source__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_data_source__plan0.xml index 8498322421..69579bc6f6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_data_source__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_data_source__plan0.xml @@ -16,6 +16,7 @@ + @@ -45,6 +46,7 @@ + @@ -72,6 +74,7 @@ + @@ -91,6 +94,7 @@ + @@ -308,6 +312,7 @@ + @@ -327,141 +332,143 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml index 6602a7c235..e3b67b94f4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml @@ -16,6 +16,7 @@ + @@ -41,6 +42,7 @@ + @@ -64,6 +66,7 @@ + @@ -79,6 +82,7 @@ + @@ -296,6 +300,7 @@ + @@ -315,141 +320,143 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml index 8c85998c73..2ec1955892 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml @@ -17,6 +17,7 @@ + @@ -34,6 +35,7 @@ + @@ -49,6 +51,7 @@ + @@ -266,6 +269,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml index 0feb69c8ce..454c16f4b0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml @@ -1,138 +1,143 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml index 1df93ed395..2680761003 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml @@ -1,138 +1,143 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml index 026e755968..fcb30f299d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml @@ -1,122 +1,127 @@ - + - + - + + - + - + + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml index 66a33827d0..1ee25e6591 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml @@ -1,138 +1,143 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml index 85a14cbc8f..b0a2da9970 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml @@ -1,192 +1,198 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml index c659b44f6d..b57b4dc13d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml @@ -1,192 +1,198 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml index c4f39f409d..669dd8d4f8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml @@ -1,318 +1,324 @@ - + - + - + + - + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -530,6 +536,7 @@ + @@ -541,282 +548,286 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -1034,6 +1045,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml index 251bf80320..c2e4f0c2de 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml @@ -1,318 +1,324 @@ - + - + - + + - + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -530,6 +536,7 @@ + @@ -541,32 +548,34 @@ - + - + - + - + - + + - + - + + @@ -575,282 +584,286 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -1068,6 +1081,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml index 67c2f3fbc6..4b5d681e41 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml @@ -1,318 +1,324 @@ - + - + - + + - + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -530,6 +536,7 @@ + @@ -541,32 +548,34 @@ - + - + - + - + - + + - + - + + @@ -575,282 +584,286 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -1068,6 +1081,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml index 12e66a947d..748fbe7657 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml @@ -1,68 +1,72 @@ - + - + - + + - + - + - + - + - + + - + - + - + - + - + + - + - + + @@ -71,282 +75,286 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -564,6 +572,7 @@ + @@ -576,32 +585,34 @@ - + - + - + - + - + + - + - + + @@ -610,282 +621,286 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -1103,6 +1118,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_one_input_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_one_input_metric__plan0.xml index ade8ece63e..d9acfd98f0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_one_input_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_one_input_metric__plan0.xml @@ -1,45 +1,48 @@ - + - + - + + - + - + - + - + - + + - + - + + @@ -48,282 +51,286 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -541,6 +548,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml index 1f3acdd2ef..e4fdf53c78 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml @@ -1,344 +1,352 @@ - + - + - + - + + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -556,6 +564,7 @@ + @@ -567,303 +576,306 @@ - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml index b617934712..3a8b6f7bad 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml @@ -10,6 +10,7 @@ + @@ -227,6 +228,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml index 4305aed311..827e08681e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml @@ -13,6 +13,7 @@ + @@ -28,6 +29,7 @@ + @@ -245,6 +247,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml index 1d26854851..22614d2018 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml @@ -1,365 +1,373 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + + - + - + - + - + - + + - + - + - + - + - + - + - + + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -577,6 +585,7 @@ + @@ -588,303 +597,306 @@ - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_conversion_events_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_conversion_events_node__plan0.xml new file mode 100644 index 0000000000..3c72601456 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_conversion_events_node__plan0.xml @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml index 88a0ddff7c..09b2694d98 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml @@ -12,6 +12,7 @@ + @@ -29,6 +30,7 @@ + @@ -44,6 +46,7 @@ + @@ -62,6 +65,7 @@ + @@ -81,6 +85,7 @@ + @@ -116,6 +121,7 @@ + @@ -135,6 +141,7 @@ + @@ -258,117 +265,119 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -398,129 +407,131 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml index 3448beb77f..305a0565aa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml @@ -22,6 +22,7 @@ + @@ -31,6 +32,7 @@ + @@ -54,6 +56,7 @@ + @@ -79,6 +82,7 @@ + @@ -98,6 +102,7 @@ + @@ -331,6 +336,7 @@ + @@ -548,6 +554,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml index 3448beb77f..305a0565aa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml @@ -22,6 +22,7 @@ + @@ -31,6 +32,7 @@ + @@ -54,6 +56,7 @@ + @@ -79,6 +82,7 @@ + @@ -98,6 +102,7 @@ + @@ -331,6 +336,7 @@ + @@ -548,6 +554,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml index 3448beb77f..305a0565aa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml @@ -22,6 +22,7 @@ + @@ -31,6 +32,7 @@ + @@ -54,6 +56,7 @@ + @@ -79,6 +82,7 @@ + @@ -98,6 +102,7 @@ + @@ -331,6 +336,7 @@ + @@ -548,6 +554,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml index 94c6fb9544..9638e49e03 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml @@ -1,295 +1,300 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -507,6 +512,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_identifier__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_identifier__plan0.xml index b04db1c2a1..26c543aa9d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_identifier__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_identifier__plan0.xml @@ -1,335 +1,340 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml index f9020e78c9..1819ba7811 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml @@ -20,6 +20,7 @@ + @@ -43,6 +44,7 @@ + @@ -260,6 +262,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml index 83d3bc6fb0..82e4886bd1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml @@ -1,73 +1,76 @@ - + - + - + + - + - + - + - + - + - + + - + - + - + - + - + - + - + + - + - + @@ -77,363 +80,370 @@ - + - + + - + - + - + - + - + + - + - + - + - + - + - + + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -651,6 +661,7 @@ + @@ -662,303 +673,306 @@ - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -974,269 +988,272 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -1454,6 +1471,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml index 8a7c5fa4cf..cdd144d0e0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml @@ -1,360 +1,368 @@ - + - + - + + - + - + - + - + - + + - + - + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -572,6 +580,7 @@ + @@ -584,269 +593,272 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -1064,6 +1076,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml index 7729192598..d17ffbde4c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml @@ -1,318 +1,324 @@ - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -530,6 +536,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml index b145df585b..56e64cf76d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml @@ -1,300 +1,306 @@ - + - + + - + - + - + - + + - + - + - + - + - + + - + - + + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -512,6 +518,7 @@ + @@ -522,310 +529,314 @@ - + - + + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml index ed99c4e35a..d6bc451d08 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml @@ -16,6 +16,7 @@ + @@ -41,6 +42,7 @@ + @@ -60,6 +62,7 @@ + @@ -95,6 +98,7 @@ + @@ -114,6 +118,7 @@ + @@ -237,117 +242,119 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -379,6 +386,7 @@ + @@ -522,7 +530,7 @@ - + @@ -530,127 +538,129 @@ + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -726,65 +736,67 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml index f4205f6511..f75947b535 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml @@ -16,6 +16,7 @@ + @@ -41,6 +42,7 @@ + @@ -60,6 +62,7 @@ + @@ -95,6 +98,7 @@ + @@ -114,6 +118,7 @@ + @@ -237,117 +242,119 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -382,6 +389,7 @@ + @@ -441,7 +449,7 @@ - + @@ -449,23 +457,25 @@ + - + - + - + - + + @@ -592,105 +602,107 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml index a3297ff739..c572384ba3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml @@ -32,6 +32,7 @@ + @@ -47,6 +48,7 @@ + @@ -264,6 +266,7 @@ + @@ -283,141 +286,143 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -438,141 +443,143 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml index 57c73a2926..b889176c69 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml @@ -12,6 +12,7 @@ + @@ -29,6 +30,7 @@ + @@ -44,6 +46,7 @@ + @@ -75,6 +78,7 @@ + @@ -94,6 +98,7 @@ + @@ -213,109 +218,111 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -343,6 +350,7 @@ + @@ -434,7 +442,7 @@ - + @@ -442,71 +450,73 @@ + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -592,73 +602,75 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml index 96f85b698f..45c6679ef0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml @@ -1,7 +1,7 @@ - + @@ -10,510 +10,516 @@ - + - + + - + - + - + + - + - + + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -731,6 +737,7 @@ + @@ -743,473 +750,479 @@ - + - + - + + - + - + + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml index 17a5c0fc72..ab86af745c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml @@ -1,364 +1,372 @@ - + - + - + + - + - + - + - + - + - + - + + - + - + - + + - + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -576,6 +584,7 @@ + @@ -587,282 +596,286 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -1080,6 +1093,7 @@ + @@ -1093,282 +1107,286 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -1586,6 +1604,7 @@ + @@ -1597,282 +1616,286 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -2090,6 +2113,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml index c3e3f2b44c..142d85d1d9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml @@ -24,6 +24,7 @@ + @@ -41,6 +42,7 @@ + @@ -66,6 +68,7 @@ + @@ -85,6 +88,7 @@ + @@ -302,6 +306,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml index 531c827437..ff2608e54b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml @@ -1,337 +1,344 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - - - - - - - + + + + + + + + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -344,158 +351,160 @@ - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml index 57765accb3..3baadf72d2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml @@ -50,6 +50,7 @@ + @@ -95,6 +96,7 @@ + @@ -109,6 +111,7 @@ + @@ -154,6 +157,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml index 1ef9811e05..716c33702e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml @@ -50,6 +50,7 @@ + @@ -95,6 +96,7 @@ + @@ -117,6 +119,7 @@ + @@ -162,6 +165,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml index 579ded4144..443a38cde2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml @@ -50,6 +50,7 @@ + @@ -95,6 +96,7 @@ + @@ -117,6 +119,7 @@ + @@ -162,6 +165,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml index 17fe7b7b27..3546a2864d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml @@ -22,6 +22,7 @@ + @@ -37,6 +38,7 @@ + @@ -254,6 +256,7 @@ + @@ -273,141 +276,143 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml index 4f373905d7..b6200b1ff4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml @@ -216,6 +216,7 @@ + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml index 10d68f55e8..70c4daa402 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml @@ -184,6 +184,7 @@ + @@ -401,6 +402,7 @@ + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml index fad0a12a45..817462a971 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml @@ -232,6 +232,7 @@ + @@ -449,6 +450,7 @@ + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml index 83994c8965..5d946649c3 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml @@ -1,7 +1,7 @@ - + @@ -14,10 +14,10 @@ - + - + @@ -26,284 +26,289 @@ + - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -521,6 +526,7 @@ + @@ -532,234 +538,238 @@ - + - + - + - + + - + - + - + - + + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -977,6 +987,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_data_source__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_data_source__dfp_0.xml index 4cd986a80b..b1f1b6f90f 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_data_source__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_data_source__dfp_0.xml @@ -76,7 +76,7 @@ - + @@ -97,12 +97,12 @@ - + - + @@ -181,7 +181,7 @@ - + @@ -202,12 +202,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_data_sources__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_data_sources__dfp_0.xml index 47e7f55a8e..066b4cf532 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_data_sources__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_data_sources__dfp_0.xml @@ -41,7 +41,7 @@ - + @@ -78,12 +78,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_data_source__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_data_source__dfp_0.xml index 16db0923c7..583fa21c60 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_data_source__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_data_source__dfp_0.xml @@ -45,7 +45,7 @@ - + @@ -91,7 +91,7 @@ - + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_data_sources__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_data_sources__dfp_0.xml index eaac97286b..7b574a78bc 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_data_sources__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_data_sources__dfp_0.xml @@ -41,7 +41,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -120,12 +120,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml index bc63d897cc..43171be140 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml @@ -41,7 +41,7 @@ - + @@ -123,7 +123,7 @@ - + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfp_0.xml index 1b5a0f41aa..2d2b072728 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfp_0.xml @@ -50,7 +50,7 @@ - + @@ -92,7 +92,7 @@ - + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfp_0.xml index d0f354e6b6..cc9647454b 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfp_0.xml @@ -41,7 +41,7 @@ - + @@ -97,7 +97,7 @@ - + @@ -139,7 +139,7 @@ - + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfp_0.xml index b8becff0df..ea100aa08b 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfp_0.xml @@ -64,7 +64,7 @@ - + @@ -106,7 +106,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -192,7 +192,7 @@ - +