diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql index 042424c85d..b86ca7f0bc 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql @@ -1,28 +1,28 @@ -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user -FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user +FROM ***************************.fct_revenue revenue_src_10007 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql index 26f04aefa0..932b17398b 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql @@ -1,53 +1,53 @@ -- Read Elements From Semantic Model 'id_verifications' SELECT 1 AS identity_verifications - , DATE_TRUNC('day', id_verifications_src_10003.ds) AS ds__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds) AS ds__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy - , DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy - , id_verifications_src_10003.verification_type - , DATE_TRUNC('day', id_verifications_src_10003.ds) AS verification__ds__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy - , DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy - , 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 + , DATE_TRUNC('day', id_verifications_src_10004.ds) AS ds__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds) AS ds__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds) AS ds__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds) AS ds__extract_doy + , DATE_TRUNC('day', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_doy + , id_verifications_src_10004.verification_type + , DATE_TRUNC('day', id_verifications_src_10004.ds) AS verification__ds__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds) AS verification__ds__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds) AS verification__ds__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds) AS verification__ds__extract_doy + , DATE_TRUNC('day', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_doy + , 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_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql index 9542d63f41..013c4e0878 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql @@ -1,28 +1,28 @@ -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy - , users_latest_src_10008.home_state_latest - , DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS user__ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds_latest__extract_doy - , 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 + DATE_TRUNC('day', users_latest_src_10009.ds) AS ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS ds_latest__extract_doy + , users_latest_src_10009.home_state_latest + , DATE_TRUNC('day', users_latest_src_10009.ds) AS user__ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS user__ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS user__ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS user__ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS user__ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS user__ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS user__ds_latest__extract_doy + , 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_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql index 042424c85d..b86ca7f0bc 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql @@ -1,28 +1,28 @@ -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user -FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user +FROM ***************************.fct_revenue revenue_src_10007 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql index 26f04aefa0..932b17398b 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql @@ -1,53 +1,53 @@ -- Read Elements From Semantic Model 'id_verifications' SELECT 1 AS identity_verifications - , DATE_TRUNC('day', id_verifications_src_10003.ds) AS ds__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds) AS ds__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy - , DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy - , id_verifications_src_10003.verification_type - , DATE_TRUNC('day', id_verifications_src_10003.ds) AS verification__ds__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy - , DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy - , 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 + , DATE_TRUNC('day', id_verifications_src_10004.ds) AS ds__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds) AS ds__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds) AS ds__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds) AS ds__extract_doy + , DATE_TRUNC('day', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_doy + , id_verifications_src_10004.verification_type + , DATE_TRUNC('day', id_verifications_src_10004.ds) AS verification__ds__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds) AS verification__ds__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds) AS verification__ds__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds) AS verification__ds__extract_doy + , DATE_TRUNC('day', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_doy + , 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_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql index 9542d63f41..013c4e0878 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql @@ -1,28 +1,28 @@ -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy - , users_latest_src_10008.home_state_latest - , DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS user__ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds_latest__extract_doy - , 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 + DATE_TRUNC('day', users_latest_src_10009.ds) AS ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS ds_latest__extract_doy + , users_latest_src_10009.home_state_latest + , DATE_TRUNC('day', users_latest_src_10009.ds) AS user__ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS user__ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS user__ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS user__ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS user__ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS user__ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS user__ds_latest__extract_doy + , 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_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql index e9c34e79c1..8e782b48da 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql @@ -55,32 +55,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0_optimized.sql index 6596468bca..efe2244b0f 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0_optimized.sql @@ -7,6 +7,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS trailing_2_months_revenue -FROM ***************************.fct_revenue revenue_src_10006 +FROM ***************************.fct_revenue revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql index 3f894968de..fb7c5634e7 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql @@ -55,32 +55,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0_optimized.sql index 06853be07e..a44bb5a72b 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0_optimized.sql @@ -7,6 +7,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS revenue_mtd -FROM ***************************.fct_revenue revenue_src_10006 +FROM ***************************.fct_revenue revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql index 2db07399cd..cf42f8c8c9 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql @@ -52,32 +52,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0_optimized.sql index ba2c45a4ca..30e9e6946d 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0_optimized.sql @@ -6,4 +6,4 @@ -- Compute Metrics via Expressions SELECT SUM(revenue) AS trailing_2_months_revenue -FROM ***************************.fct_revenue revenue_src_10006 +FROM ***************************.fct_revenue revenue_src_10007 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql index 883b02bd6e..2e2e9a1615 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql @@ -55,32 +55,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0_optimized.sql index 220fb6083c..ccf3a0f545 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0_optimized.sql @@ -7,6 +7,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS revenue_all_time -FROM ***************************.fct_revenue revenue_src_10006 +FROM ***************************.fct_revenue revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 672f04d4d2..f8f9b92af1 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -94,32 +94,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 WHERE subq_1.metric_time__day BETWEEN '2000-01-01' AND '2020-01-01' diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql index dfc97e9ec9..626c4d3de3 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql @@ -8,7 +8,7 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS revenue_all_time -FROM ***************************.fct_revenue revenue_src_10006 +FROM ***************************.fct_revenue revenue_src_10007 WHERE DATE_TRUNC('day', created_at) BETWEEN '2000-01-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql index 2afa239f5c..b0b8fc7f6f 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql @@ -145,32 +145,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 WHERE subq_1.metric_time__day BETWEEN '2019-11-01' AND '2020-01-01' diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0_optimized.sql index a07cb2047d..aeca8a05d9 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0_optimized.sql @@ -22,7 +22,7 @@ INNER JOIN ( DATE_TRUNC('day', created_at) AS metric_time__day , DATE_TRUNC('month', created_at) AS metric_time__month , revenue AS txn_revenue - FROM ***************************.fct_revenue revenue_src_10006 + FROM ***************************.fct_revenue revenue_src_10007 WHERE DATE_TRUNC('day', created_at) BETWEEN '2019-11-01' AND '2020-01-01' ) subq_11 ON diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql index e9c34e79c1..8e782b48da 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql @@ -55,32 +55,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0_optimized.sql index 6596468bca..efe2244b0f 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0_optimized.sql @@ -7,6 +7,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS trailing_2_months_revenue -FROM ***************************.fct_revenue revenue_src_10006 +FROM ***************************.fct_revenue revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql index 3f894968de..fb7c5634e7 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql @@ -55,32 +55,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0_optimized.sql index 06853be07e..a44bb5a72b 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0_optimized.sql @@ -7,6 +7,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS revenue_mtd -FROM ***************************.fct_revenue revenue_src_10006 +FROM ***************************.fct_revenue revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql index 2db07399cd..cf42f8c8c9 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql @@ -52,32 +52,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0_optimized.sql index ba2c45a4ca..30e9e6946d 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0_optimized.sql @@ -6,4 +6,4 @@ -- Compute Metrics via Expressions SELECT SUM(revenue) AS trailing_2_months_revenue -FROM ***************************.fct_revenue revenue_src_10006 +FROM ***************************.fct_revenue revenue_src_10007 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql index 883b02bd6e..2e2e9a1615 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql @@ -55,32 +55,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 ) subq_2 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0_optimized.sql index 220fb6083c..ccf3a0f545 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0_optimized.sql @@ -7,6 +7,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS revenue_all_time -FROM ***************************.fct_revenue revenue_src_10006 +FROM ***************************.fct_revenue revenue_src_10007 GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 672f04d4d2..f8f9b92af1 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -94,32 +94,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 WHERE subq_1.metric_time__day BETWEEN '2000-01-01' AND '2020-01-01' diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql index dfc97e9ec9..626c4d3de3 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql @@ -8,7 +8,7 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS revenue_all_time -FROM ***************************.fct_revenue revenue_src_10006 +FROM ***************************.fct_revenue revenue_src_10007 WHERE DATE_TRUNC('day', created_at) BETWEEN '2000-01-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql index 7b83bc743e..fe5aede2c9 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql @@ -145,32 +145,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'revenue' SELECT - revenue_src_10006.revenue AS txn_revenue - , DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day - , 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 - , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy - , DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day - , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week - , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month - , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter - , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(isodow FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy - , revenue_src_10006.user_id AS user - , revenue_src_10006.user_id AS company__user - FROM ***************************.fct_revenue revenue_src_10006 + revenue_src_10007.revenue AS txn_revenue + , DATE_TRUNC('day', revenue_src_10007.created_at) AS ds__day + , 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 + , EXTRACT(year FROM revenue_src_10007.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS company__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS company__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS company__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS company__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS company__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS company__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS company__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , revenue_src_10007.user_id AS user + , revenue_src_10007.user_id AS company__user + FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 WHERE subq_1.metric_time__day BETWEEN '2019-11-01' AND '2020-01-01' diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0_optimized.sql index d9f814c03e..be9486e423 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0_optimized.sql @@ -22,7 +22,7 @@ INNER JOIN ( DATE_TRUNC('day', created_at) AS metric_time__day , DATE_TRUNC('month', created_at) AS metric_time__month , revenue AS txn_revenue - FROM ***************************.fct_revenue revenue_src_10006 + FROM ***************************.fct_revenue revenue_src_10007 WHERE DATE_TRUNC('day', created_at) BETWEEN '2019-11-01' AND '2020-01-01' ) subq_11 ON diff --git a/metricflow/test/snapshots/test_cyclic_join.py/DataflowPlan/test_cyclic_join__dfp_0.xml b/metricflow/test/snapshots/test_cyclic_join.py/DataflowPlan/test_cyclic_join__dfp_0.xml index 40e78e3dac..81fa0e5fa9 100644 --- a/metricflow/test/snapshots/test_cyclic_join.py/DataflowPlan/test_cyclic_join__dfp_0.xml +++ b/metricflow/test/snapshots/test_cyclic_join.py/DataflowPlan/test_cyclic_join__dfp_0.xml @@ -61,12 +61,12 @@ - + - + @@ -89,7 +89,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_semantic_model__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_semantic_model__dfp_0.xml index a22f6531b8..17e62c62b1 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_semantic_model__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_semantic_model__dfp_0.xml @@ -79,7 +79,7 @@ - + @@ -96,12 +96,12 @@ - + - + @@ -185,7 +185,7 @@ - + @@ -202,12 +202,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_with_metric_time__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_with_metric_time__dfp_0.xml index eec481fede..969b2b3105 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_with_metric_time__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_with_metric_time__dfp_0.xml @@ -38,12 +38,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_without_metric_time__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_without_metric_time__dfp_0.xml index 482446a4f0..cf5446e5cf 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_without_metric_time__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_without_metric_time__dfp_0.xml @@ -28,12 +28,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_with_window__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_with_window__dfp_0.xml index 385ebf8855..918dc93650 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_with_window__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_with_window__dfp_0.xml @@ -38,12 +38,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_to_grain__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_to_grain__dfp_0.xml index 6c9913097d..7bdc835a45 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_to_grain__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_to_grain__dfp_0.xml @@ -53,7 +53,7 @@ - + @@ -113,7 +113,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_window__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_window__dfp_0.xml index c124ff3b33..fe203c592e 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_window__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_window__dfp_0.xml @@ -66,7 +66,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_with_granularity__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_with_granularity__dfp_0.xml index 3e4efaa3bc..1d67ac6a40 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_with_granularity__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_with_granularity__dfp_0.xml @@ -66,7 +66,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_offset_cumulative_metric__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_offset_cumulative_metric__dfp_0.xml index 28e1ba6a80..cb9c812a1c 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_offset_cumulative_metric__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_offset_cumulative_metric__dfp_0.xml @@ -69,7 +69,7 @@ - + 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 f222418611..bc88e60b4f 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 @@ -40,7 +40,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan_with_join__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan_with_join__dfp_0.xml index 975ea90960..2c870ebfcd 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan_with_join__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan_with_join__dfp_0.xml @@ -57,7 +57,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_dont_join_to_time_spine_if_no_time_dimension_requested__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_dont_join_to_time_spine_if_no_time_dimension_requested__dfp_0.xml index f4fc83bc2b..d290eff229 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_dont_join_to_time_spine_if_no_time_dimension_requested__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_dont_join_to_time_spine_if_no_time_dimension_requested__dfp_0.xml @@ -33,7 +33,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_derived_metric__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_derived_metric__dfp_0.xml index ba96239d86..393004bd9e 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_derived_metric__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_derived_metric__dfp_0.xml @@ -67,7 +67,7 @@ - + @@ -144,7 +144,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_metric_time__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_metric_time__dfp_0.xml index 77a4943244..fdb54e958c 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_metric_time__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_metric_time__dfp_0.xml @@ -54,7 +54,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_non_metric_time__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_non_metric_time__dfp_0.xml index 55b6fc1e28..8a59e24a93 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_non_metric_time__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_non_metric_time__dfp_0.xml @@ -40,7 +40,7 @@ - + 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 2e6ad5159b..2ad866e7db 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 @@ -70,7 +70,7 @@ - + @@ -87,12 +87,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 193da08216..342b619dd3 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 @@ -44,7 +44,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 749d39917d..fe9bdfe778 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 @@ -131,7 +131,7 @@ - + @@ -147,12 +147,12 @@ - + - + @@ -280,7 +280,7 @@ - + @@ -296,12 +296,12 @@ - + - + @@ -351,7 +351,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 8d146e3041..d9ca64f81d 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 @@ -99,7 +99,7 @@ - + @@ -147,7 +147,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_semantic_model_ratio_metrics_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_semantic_model_ratio_metrics_plan__dfp_0.xml index ddf15aebc4..725e533727 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_semantic_model_ratio_metrics_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_semantic_model_ratio_metrics_plan__dfp_0.xml @@ -89,7 +89,7 @@ - + @@ -106,12 +106,12 @@ - + - + @@ -190,12 +190,12 @@ - + - + @@ -212,12 +212,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 c7808c613a..e5e5253dd1 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 @@ -80,12 +80,12 @@ - + - + @@ -140,7 +140,7 @@ - + @@ -347,7 +347,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 1ff685a04e..4f9272614c 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 @@ -47,7 +47,7 @@ - + @@ -97,7 +97,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_nested_derived_metric_with_outer_offset__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_nested_derived_metric_with_outer_offset__dfp_0.xml index 2c781b1527..ae0cab066f 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_nested_derived_metric_with_outer_offset__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_nested_derived_metric_with_outer_offset__dfp_0.xml @@ -92,7 +92,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 ae588dbc5e..442640f4fc 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_primary_entity_dimension__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_primary_entity_dimension__dfp_0.xml index a8d8373588..02cf26f5da 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_primary_entity_dimension__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_primary_entity_dimension__dfp_0.xml @@ -37,7 +37,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 a8d8373588..02cf26f5da 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 @@ -37,7 +37,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_semantic_model_ratio_metrics_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_semantic_model_ratio_metrics_plan__dfp_0.xml index ee7a40eceb..abec5fc823 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_semantic_model_ratio_metrics_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_semantic_model_ratio_metrics_plan__dfp_0.xml @@ -89,7 +89,7 @@ - + @@ -106,12 +106,12 @@ - + - + @@ -195,7 +195,7 @@ - + @@ -212,12 +212,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 14d24551f2..b444ca5dd1 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 @@ -99,7 +99,7 @@ - + @@ -116,12 +116,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 c9a38b5cb2..8c4610221b 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 @@ -75,7 +75,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 1fc2c1f0e1..1e8ee7dfe4 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 @@ - + @@ -93,12 +93,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDB/test_joined_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDB/test_joined_plan__ep_0.xml index 99c2c23a43..e224019fce 100644 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDB/test_joined_plan__ep_0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDB/test_joined_plan__ep_0.xml @@ -10,7 +10,7 @@ - + @@ -24,11 +24,11 @@ - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDB/test_multihop_joined_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDB/test_multihop_joined_plan__ep_0.xml index ab375ac0d1..c5d17a25a0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDB/test_multihop_joined_plan__ep_0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/DuckDB/test_multihop_joined_plan__ep_0.xml @@ -10,31 +10,31 @@ - - + + - - - - + + + + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/Postgres/test_joined_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/Postgres/test_joined_plan__ep_0.xml index 99c2c23a43..e224019fce 100644 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/Postgres/test_joined_plan__ep_0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/Postgres/test_joined_plan__ep_0.xml @@ -10,7 +10,7 @@ - + @@ -24,11 +24,11 @@ - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/Postgres/test_multihop_joined_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/Postgres/test_multihop_joined_plan__ep_0.xml index ab375ac0d1..c5d17a25a0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/Postgres/test_multihop_joined_plan__ep_0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/Postgres/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 c56df6a05c..6c98fd0a45 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 @@ -60,7 +60,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql index 8acd57a67f..b46218bd01 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql @@ -125,62 +125,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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/DuckDB/test_compute_metrics_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0_optimized.sql index 7a53d1c84e..9e5210f489 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/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 Semantic Model 'bookings_source' @@ -15,9 +15,9 @@ FROM ( FROM ***************************.fct_bookings 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/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index dda45db51d..5cdac9f816 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -319,62 +319,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 @@ -487,55 +487,55 @@ FROM ( -- Read Elements From Semantic Model 'views_source' SELECT 1 AS views - , DATE_TRUNC('day', views_source_src_10009.ds) AS ds__day - , 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 - , EXTRACT(year FROM views_source_src_10009.ds) AS ds__extract_year - , EXTRACT(quarter FROM views_source_src_10009.ds) AS ds__extract_quarter - , EXTRACT(month FROM views_source_src_10009.ds) AS ds__extract_month - , EXTRACT(day FROM views_source_src_10009.ds) AS ds__extract_day - , EXTRACT(isodow FROM views_source_src_10009.ds) AS ds__extract_dow - , EXTRACT(doy FROM views_source_src_10009.ds) AS ds__extract_doy - , DATE_TRUNC('day', views_source_src_10009.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy - , DATE_TRUNC('day', views_source_src_10009.ds) AS view__ds__day - , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week - , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month - , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter - , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year - , EXTRACT(year FROM views_source_src_10009.ds) AS view__ds__extract_year - , EXTRACT(quarter FROM views_source_src_10009.ds) AS view__ds__extract_quarter - , EXTRACT(month FROM views_source_src_10009.ds) AS view__ds__extract_month - , EXTRACT(day FROM views_source_src_10009.ds) AS view__ds__extract_day - , EXTRACT(isodow FROM views_source_src_10009.ds) AS view__ds__extract_dow - , EXTRACT(doy FROM views_source_src_10009.ds) AS view__ds__extract_doy - , DATE_TRUNC('day', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__day - , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week - , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month - , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter - , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year - , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year - , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter - , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month - , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day - , EXTRACT(isodow FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow - , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy - , views_source_src_10009.listing_id AS listing - , views_source_src_10009.user_id AS user - , views_source_src_10009.listing_id AS view__listing - , views_source_src_10009.user_id AS view__user - FROM ***************************.fct_views views_source_src_10009 + , DATE_TRUNC('day', views_source_src_10010.ds) AS ds__day + , 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 + , EXTRACT(year FROM views_source_src_10010.ds) AS ds__extract_year + , EXTRACT(quarter FROM views_source_src_10010.ds) AS ds__extract_quarter + , EXTRACT(month FROM views_source_src_10010.ds) AS ds__extract_month + , EXTRACT(day FROM views_source_src_10010.ds) AS ds__extract_day + , EXTRACT(isodow FROM views_source_src_10010.ds) AS ds__extract_dow + , EXTRACT(doy FROM views_source_src_10010.ds) AS ds__extract_doy + , DATE_TRUNC('day', views_source_src_10010.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_doy + , DATE_TRUNC('day', views_source_src_10010.ds) AS view__ds__day + , DATE_TRUNC('week', views_source_src_10010.ds) AS view__ds__week + , DATE_TRUNC('month', views_source_src_10010.ds) AS view__ds__month + , DATE_TRUNC('quarter', views_source_src_10010.ds) AS view__ds__quarter + , DATE_TRUNC('year', views_source_src_10010.ds) AS view__ds__year + , EXTRACT(year FROM views_source_src_10010.ds) AS view__ds__extract_year + , EXTRACT(quarter FROM views_source_src_10010.ds) AS view__ds__extract_quarter + , EXTRACT(month FROM views_source_src_10010.ds) AS view__ds__extract_month + , EXTRACT(day FROM views_source_src_10010.ds) AS view__ds__extract_day + , EXTRACT(isodow FROM views_source_src_10010.ds) AS view__ds__extract_dow + , EXTRACT(doy FROM views_source_src_10010.ds) AS view__ds__extract_doy + , DATE_TRUNC('day', views_source_src_10010.ds_partitioned) AS view__ds_partitioned__day + , DATE_TRUNC('week', views_source_src_10010.ds_partitioned) AS view__ds_partitioned__week + , DATE_TRUNC('month', views_source_src_10010.ds_partitioned) AS view__ds_partitioned__month + , DATE_TRUNC('quarter', views_source_src_10010.ds_partitioned) AS view__ds_partitioned__quarter + , DATE_TRUNC('year', views_source_src_10010.ds_partitioned) AS view__ds_partitioned__year + , EXTRACT(year FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(day FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(isodow FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_doy + , views_source_src_10010.listing_id AS listing + , views_source_src_10010.user_id AS user + , views_source_src_10010.listing_id AS view__listing + , views_source_src_10010.user_id AS view__user + FROM ***************************.fct_views views_source_src_10010 ) subq_10 ) subq_11 ) subq_12 @@ -619,62 +619,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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_13 ) subq_14 ) subq_15 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0_optimized.sql index 635bfacdef..ee6adb1fd6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0_optimized.sql @@ -18,7 +18,7 @@ FROM ( -- Compute Metrics via Expressions SELECT subq_23.ds__day AS ds__day - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_23.bookings) AS bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -32,12 +32,12 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_10001 ) subq_23 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_23.listing = listings_latest_src_10004.listing_id + subq_23.listing = listings_latest_src_10005.listing_id GROUP BY subq_23.ds__day - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_30 FULL OUTER JOIN ( -- Join Standard Outputs @@ -47,7 +47,7 @@ FROM ( -- Compute Metrics via Expressions SELECT subq_33.ds__day AS ds__day - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_33.views) AS views FROM ( -- Read Elements From Semantic Model 'views_source' @@ -58,15 +58,15 @@ FROM ( DATE_TRUNC('day', ds) AS ds__day , listing_id AS listing , 1 AS views - FROM ***************************.fct_views views_source_src_10009 + FROM ***************************.fct_views views_source_src_10010 ) subq_33 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_33.listing = listings_latest_src_10004.listing_id + subq_33.listing = listings_latest_src_10005.listing_id GROUP BY subq_33.ds__day - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_40 ON ( diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index 583678d2d6..8c1ec0651c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -128,62 +128,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0_optimized.sql index f22bdaf7cb..0bfa1bff7f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__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 ( @@ -22,10 +22,10 @@ FROM ( FROM ***************************.fct_bookings 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/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql index f04f16e5bf..7bbc7fb3b9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql @@ -125,62 +125,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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/DuckDB/test_compute_metrics_node_simple_expr__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0_optimized.sql index caa4c0c6fe..5a844f2632 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0_optimized.sql @@ -8,14 +8,14 @@ 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 ***************************.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/DuckDB/test_conversion_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_conversion_metric__plan0.sql index 0a56dd7299..1d27c3c247 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_conversion_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_conversion_metric__plan0.sql @@ -1,13 +1,13 @@ -- Compute Metrics via Expressions SELECT - subq_15.visit__referrer_id - , CAST(subq_15.buys AS DOUBLE) / CAST(NULLIF(subq_15.visits, 0) AS DOUBLE) AS visit_buy_conversion_rate + subq_14.visit__referrer_id + , CAST(subq_14.buys AS DOUBLE) / CAST(NULLIF(subq_14.visits, 0) AS DOUBLE) AS visit_buy_conversion_rate FROM ( - -- Combine Metrics + -- Combine Aggregated Outputs SELECT - COALESCE(subq_3.visit__referrer_id, subq_14.visit__referrer_id) AS visit__referrer_id + COALESCE(subq_3.visit__referrer_id, subq_13.visit__referrer_id) AS visit__referrer_id , MAX(subq_3.visits) AS visits - , MAX(subq_14.buys) AS buys + , MAX(subq_13.buys) AS buys FROM ( -- Aggregate Measures SELECT @@ -56,7 +56,9 @@ FROM ( , subq_0.ds__extract_dow AS metric_time__extract_dow , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user + , subq_0.session , subq_0.visit__user + , subq_0.visit__session , subq_0.referrer_id , subq_0.visit__referrer_id , subq_0.visits @@ -91,7 +93,9 @@ FROM ( , EXTRACT(doy FROM visits_source_src_10011.ds) AS visit__ds__extract_doy , visits_source_src_10011.referrer_id AS visit__referrer_id , visits_source_src_10011.user_id AS user + , visits_source_src_10011.session_id AS session , visits_source_src_10011.user_id AS visit__user + , visits_source_src_10011.session_id AS visit__session FROM ***************************.fct_visits visits_source_src_10011 ) subq_0 ) subq_1 @@ -102,32 +106,38 @@ FROM ( FULL OUTER JOIN ( -- Aggregate Measures SELECT - subq_13.visit__referrer_id - , SUM(subq_13.buys) AS buys + subq_12.visit__referrer_id + , SUM(subq_12.buys) AS buys FROM ( -- Pass Only Elements: -- ['buys', 'visit__referrer_id'] SELECT - subq_12.visit__referrer_id - , subq_12.buys + subq_11.visit__referrer_id + , subq_11.buys FROM ( -- Find conversions for EntitySpec(element_name='user', entity_links=()) within the range of count=7 granularity=TimeGranularity.DAY SELECT - subq_11.visit__referrer_id - , subq_11.buys - , subq_11.visits + subq_10.ds__day + , subq_10.user + , subq_10.visit__referrer_id + , subq_10.buys + , subq_10.visits FROM ( -- Dedupe the fanout on (MetadataSpec(element_name='mf_internal_uuid'),) in the conversion data set SELECT DISTINCT - first_value(subq_6.visits) OVER (PARTITION BY subq_10.user, subq_10.ds__day ORDER BY subq_6.ds__day DESC) AS visits - , first_value(subq_6.visit__referrer_id) OVER (PARTITION BY subq_10.user, subq_10.ds__day ORDER BY subq_6.ds__day DESC) AS visit__referrer_id - , subq_10.mf_internal_uuid AS mf_internal_uuid - , subq_10.buys AS buys + first_value(subq_6.visits) OVER (PARTITION BY subq_9.user, subq_9.ds__day, subq_9.mf_internal_uuid ORDER BY subq_6.ds__day DESC) AS visits + , first_value(subq_6.visit__referrer_id) OVER (PARTITION BY subq_9.user, subq_9.ds__day, subq_9.mf_internal_uuid ORDER BY subq_6.ds__day DESC) AS visit__referrer_id + , first_value(subq_6.ds__day) OVER (PARTITION BY subq_9.user, subq_9.ds__day, subq_9.mf_internal_uuid ORDER BY subq_6.ds__day DESC) AS ds__day + , first_value(subq_6.user) OVER (PARTITION BY subq_9.user, subq_9.ds__day, subq_9.mf_internal_uuid ORDER BY subq_6.ds__day DESC) AS user + , subq_9.mf_internal_uuid AS mf_internal_uuid + , subq_9.buys AS buys FROM ( -- Pass Only Elements: - -- ['visits', 'visit__referrer_id'] + -- ['visits', 'visit__referrer_id', 'ds__day', 'user'] SELECT - subq_5.visit__referrer_id + subq_5.ds__day + , subq_5.user + , subq_5.visit__referrer_id , subq_5.visits FROM ( -- Metric Time Dimension 'ds' @@ -166,7 +176,9 @@ FROM ( , subq_4.ds__extract_dow AS metric_time__extract_dow , subq_4.ds__extract_doy AS metric_time__extract_doy , subq_4.user + , subq_4.session , subq_4.visit__user + , subq_4.visit__session , subq_4.referrer_id , subq_4.visit__referrer_id , subq_4.visits @@ -201,150 +213,151 @@ FROM ( , EXTRACT(doy FROM visits_source_src_10011.ds) AS visit__ds__extract_doy , visits_source_src_10011.referrer_id AS visit__referrer_id , visits_source_src_10011.user_id AS user + , visits_source_src_10011.session_id AS session , visits_source_src_10011.user_id AS visit__user + , visits_source_src_10011.session_id AS visit__session FROM ***************************.fct_visits visits_source_src_10011 ) subq_4 ) subq_5 ) subq_6 INNER JOIN ( - -- Pass Only Elements: - -- ['buys', 'mf_internal_uuid'] + -- Add column with generated UUID SELECT - subq_9.buys - , subq_9.mf_internal_uuid + subq_8.ds__day + , subq_8.ds__week + , subq_8.ds__month + , subq_8.ds__quarter + , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_day + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy + , subq_8.buy__ds__day + , subq_8.buy__ds__week + , subq_8.buy__ds__month + , subq_8.buy__ds__quarter + , subq_8.buy__ds__year + , subq_8.buy__ds__extract_year + , subq_8.buy__ds__extract_quarter + , subq_8.buy__ds__extract_month + , subq_8.buy__ds__extract_day + , subq_8.buy__ds__extract_dow + , subq_8.buy__ds__extract_doy + , subq_8.metric_time__day + , subq_8.metric_time__week + , subq_8.metric_time__month + , subq_8.metric_time__quarter + , subq_8.metric_time__year + , subq_8.metric_time__extract_year + , subq_8.metric_time__extract_quarter + , subq_8.metric_time__extract_month + , subq_8.metric_time__extract_day + , subq_8.metric_time__extract_dow + , subq_8.metric_time__extract_doy + , subq_8.user + , subq_8.session_id + , subq_8.buy__user + , subq_8.buy__session_id + , subq_8.buys + , subq_8.buyers + , GEN_RANDOM_UUID() AS mf_internal_uuid FROM ( - -- Add column with generated UUID + -- Metric Time Dimension 'ds' SELECT - subq_8.ds__day - , subq_8.ds__week - , subq_8.ds__month - , subq_8.ds__quarter - , subq_8.ds__year - , subq_8.ds__extract_year - , subq_8.ds__extract_quarter - , subq_8.ds__extract_month - , subq_8.ds__extract_day - , subq_8.ds__extract_dow - , subq_8.ds__extract_doy - , subq_8.buy__ds__day - , subq_8.buy__ds__week - , subq_8.buy__ds__month - , subq_8.buy__ds__quarter - , subq_8.buy__ds__year - , subq_8.buy__ds__extract_year - , subq_8.buy__ds__extract_quarter - , subq_8.buy__ds__extract_month - , subq_8.buy__ds__extract_day - , subq_8.buy__ds__extract_dow - , subq_8.buy__ds__extract_doy - , subq_8.metric_time__day - , subq_8.metric_time__week - , subq_8.metric_time__month - , subq_8.metric_time__quarter - , subq_8.metric_time__year - , subq_8.metric_time__extract_year - , subq_8.metric_time__extract_quarter - , subq_8.metric_time__extract_month - , subq_8.metric_time__extract_day - , subq_8.metric_time__extract_dow - , subq_8.metric_time__extract_doy - , subq_8.user - , subq_8.buy__user - , subq_8.buys - , subq_8.buyers - , GEN_RANDOM_UUID() AS mf_internal_uuid + subq_7.ds__day + , subq_7.ds__week + , subq_7.ds__month + , subq_7.ds__quarter + , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_day + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy + , subq_7.buy__ds__day + , subq_7.buy__ds__week + , subq_7.buy__ds__month + , subq_7.buy__ds__quarter + , subq_7.buy__ds__year + , subq_7.buy__ds__extract_year + , subq_7.buy__ds__extract_quarter + , subq_7.buy__ds__extract_month + , subq_7.buy__ds__extract_day + , subq_7.buy__ds__extract_dow + , subq_7.buy__ds__extract_doy + , subq_7.ds__day AS metric_time__day + , subq_7.ds__week AS metric_time__week + , subq_7.ds__month AS metric_time__month + , subq_7.ds__quarter AS metric_time__quarter + , subq_7.ds__year AS metric_time__year + , subq_7.ds__extract_year AS metric_time__extract_year + , subq_7.ds__extract_quarter AS metric_time__extract_quarter + , subq_7.ds__extract_month AS metric_time__extract_month + , subq_7.ds__extract_day AS metric_time__extract_day + , subq_7.ds__extract_dow AS metric_time__extract_dow + , subq_7.ds__extract_doy AS metric_time__extract_doy + , subq_7.user + , subq_7.session_id + , subq_7.buy__user + , subq_7.buy__session_id + , subq_7.buys + , subq_7.buyers FROM ( - -- Metric Time Dimension 'ds' + -- Read Elements From Semantic Model 'buys_source' SELECT - subq_7.ds__day - , subq_7.ds__week - , subq_7.ds__month - , subq_7.ds__quarter - , subq_7.ds__year - , subq_7.ds__extract_year - , subq_7.ds__extract_quarter - , subq_7.ds__extract_month - , subq_7.ds__extract_day - , subq_7.ds__extract_dow - , subq_7.ds__extract_doy - , subq_7.buy__ds__day - , subq_7.buy__ds__week - , subq_7.buy__ds__month - , subq_7.buy__ds__quarter - , subq_7.buy__ds__year - , subq_7.buy__ds__extract_year - , subq_7.buy__ds__extract_quarter - , subq_7.buy__ds__extract_month - , subq_7.buy__ds__extract_day - , subq_7.buy__ds__extract_dow - , subq_7.buy__ds__extract_doy - , subq_7.ds__day AS metric_time__day - , subq_7.ds__week AS metric_time__week - , subq_7.ds__month AS metric_time__month - , subq_7.ds__quarter AS metric_time__quarter - , subq_7.ds__year AS metric_time__year - , subq_7.ds__extract_year AS metric_time__extract_year - , subq_7.ds__extract_quarter AS metric_time__extract_quarter - , subq_7.ds__extract_month AS metric_time__extract_month - , subq_7.ds__extract_day AS metric_time__extract_day - , subq_7.ds__extract_dow AS metric_time__extract_dow - , subq_7.ds__extract_doy AS metric_time__extract_doy - , subq_7.user - , subq_7.buy__user - , subq_7.buys - , subq_7.buyers - FROM ( - -- Read Elements From Semantic Model 'buys_source' - SELECT - 1 AS buys - , buys_source_src_10002.user_id AS buyers - , DATE_TRUNC('day', buys_source_src_10002.ds) AS ds__day - , 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 - , EXTRACT(year FROM buys_source_src_10002.ds) AS ds__extract_year - , EXTRACT(quarter FROM buys_source_src_10002.ds) AS ds__extract_quarter - , EXTRACT(month FROM buys_source_src_10002.ds) AS ds__extract_month - , EXTRACT(day FROM buys_source_src_10002.ds) AS ds__extract_day - , EXTRACT(isodow FROM buys_source_src_10002.ds) AS ds__extract_dow - , EXTRACT(doy FROM buys_source_src_10002.ds) AS ds__extract_doy - , DATE_TRUNC('day', buys_source_src_10002.ds) AS buy__ds__day - , DATE_TRUNC('week', buys_source_src_10002.ds) AS buy__ds__week - , DATE_TRUNC('month', buys_source_src_10002.ds) AS buy__ds__month - , DATE_TRUNC('quarter', buys_source_src_10002.ds) AS buy__ds__quarter - , DATE_TRUNC('year', buys_source_src_10002.ds) AS buy__ds__year - , EXTRACT(year FROM buys_source_src_10002.ds) AS buy__ds__extract_year - , EXTRACT(quarter FROM buys_source_src_10002.ds) AS buy__ds__extract_quarter - , EXTRACT(month FROM buys_source_src_10002.ds) AS buy__ds__extract_month - , EXTRACT(day FROM buys_source_src_10002.ds) AS buy__ds__extract_day - , EXTRACT(isodow FROM buys_source_src_10002.ds) AS buy__ds__extract_dow - , EXTRACT(doy FROM buys_source_src_10002.ds) AS buy__ds__extract_doy - , buys_source_src_10002.user_id AS user - , buys_source_src_10002.user_id AS buy__user - FROM ***************************.fct_buys buys_source_src_10002 - ) subq_7 - ) subq_8 - ) subq_9 - ) subq_10 + 1 AS buys + , buys_source_src_10002.user_id AS buyers + , DATE_TRUNC('day', buys_source_src_10002.ds) AS ds__day + , 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 + , EXTRACT(year FROM buys_source_src_10002.ds) AS ds__extract_year + , EXTRACT(quarter FROM buys_source_src_10002.ds) AS ds__extract_quarter + , EXTRACT(month FROM buys_source_src_10002.ds) AS ds__extract_month + , EXTRACT(day FROM buys_source_src_10002.ds) AS ds__extract_day + , EXTRACT(isodow FROM buys_source_src_10002.ds) AS ds__extract_dow + , EXTRACT(doy FROM buys_source_src_10002.ds) AS ds__extract_doy + , DATE_TRUNC('day', buys_source_src_10002.ds) AS buy__ds__day + , DATE_TRUNC('week', buys_source_src_10002.ds) AS buy__ds__week + , DATE_TRUNC('month', buys_source_src_10002.ds) AS buy__ds__month + , DATE_TRUNC('quarter', buys_source_src_10002.ds) AS buy__ds__quarter + , DATE_TRUNC('year', buys_source_src_10002.ds) AS buy__ds__year + , EXTRACT(year FROM buys_source_src_10002.ds) AS buy__ds__extract_year + , EXTRACT(quarter FROM buys_source_src_10002.ds) AS buy__ds__extract_quarter + , EXTRACT(month FROM buys_source_src_10002.ds) AS buy__ds__extract_month + , EXTRACT(day FROM buys_source_src_10002.ds) AS buy__ds__extract_day + , EXTRACT(isodow FROM buys_source_src_10002.ds) AS buy__ds__extract_dow + , EXTRACT(doy FROM buys_source_src_10002.ds) AS buy__ds__extract_doy + , buys_source_src_10002.user_id AS user + , buys_source_src_10002.session_id + , buys_source_src_10002.user_id AS buy__user + , buys_source_src_10002.session_id AS buy__session_id + FROM ***************************.fct_buys buys_source_src_10002 + ) subq_7 + ) subq_8 + ) subq_9 ON ( - subq_6.user = subq_10.user + subq_6.user = subq_9.user ) AND ( ( - subq_6.ds__day <= subq_10.ds__day + subq_6.ds__day <= subq_9.ds__day ) AND ( - subq_6.ds__day > subq_10.ds__day - INTERVAL 7 day + subq_6.ds__day > subq_9.ds__day - INTERVAL 7 day ) ) - ) subq_11 - ) subq_12 - ) subq_13 + ) subq_10 + ) subq_11 + ) subq_12 GROUP BY - subq_13.visit__referrer_id - ) subq_14 + subq_12.visit__referrer_id + ) subq_13 ON - subq_3.visit__referrer_id = subq_14.visit__referrer_id + subq_3.visit__referrer_id = subq_13.visit__referrer_id GROUP BY - COALESCE(subq_3.visit__referrer_id, subq_14.visit__referrer_id) -) subq_15 + COALESCE(subq_3.visit__referrer_id, subq_13.visit__referrer_id) +) subq_14 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_conversion_metric__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_conversion_metric__plan0_optimized.sql index f340be4a39..23dfb64226 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_conversion_metric__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_conversion_metric__plan0_optimized.sql @@ -3,11 +3,11 @@ SELECT visit__referrer_id , CAST(buys AS DOUBLE) / CAST(NULLIF(visits, 0) AS DOUBLE) AS visit_buy_conversion_rate FROM ( - -- Combine Metrics + -- Combine Aggregated Outputs SELECT - COALESCE(subq_19.visit__referrer_id, subq_30.visit__referrer_id) AS visit__referrer_id - , MAX(subq_19.visits) AS visits - , MAX(subq_30.buys) AS buys + COALESCE(subq_18.visit__referrer_id, subq_28.visit__referrer_id) AS visit__referrer_id + , MAX(subq_18.visits) AS visits + , MAX(subq_28.buys) AS buys FROM ( -- Aggregate Measures SELECT @@ -22,10 +22,10 @@ FROM ( referrer_id AS visit__referrer_id , 1 AS visits FROM ***************************.fct_visits visits_source_src_10011 - ) subq_18 + ) subq_17 GROUP BY visit__referrer_id - ) subq_19 + ) subq_18 FULL OUTER JOIN ( -- Find conversions for EntitySpec(element_name='user', entity_links=()) within the range of count=7 granularity=TimeGranularity.DAY -- Pass Only Elements: @@ -37,47 +37,51 @@ FROM ( FROM ( -- Dedupe the fanout on (MetadataSpec(element_name='mf_internal_uuid'),) in the conversion data set SELECT DISTINCT - first_value(subq_22.visits) OVER (PARTITION BY subq_26.user, subq_26.ds__day ORDER BY subq_22.ds__day DESC) AS visits - , first_value(subq_22.visit__referrer_id) OVER (PARTITION BY subq_26.user, subq_26.ds__day ORDER BY subq_22.ds__day DESC) AS visit__referrer_id - , subq_26.mf_internal_uuid AS mf_internal_uuid - , subq_26.buys AS buys + first_value(subq_21.visits) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC) AS visits + , first_value(subq_21.visit__referrer_id) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC) AS visit__referrer_id + , first_value(subq_21.ds__day) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC) AS ds__day + , first_value(subq_21.user) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC) AS user + , subq_24.mf_internal_uuid AS mf_internal_uuid + , subq_24.buys AS buys FROM ( -- Read Elements From Semantic Model 'visits_source' -- Metric Time Dimension 'ds' -- Pass Only Elements: - -- ['visits', 'visit__referrer_id'] + -- ['visits', 'visit__referrer_id', 'ds__day', 'user'] SELECT - referrer_id AS visit__referrer_id + DATE_TRUNC('day', ds) AS ds__day + , user_id AS user + , referrer_id AS visit__referrer_id , 1 AS visits FROM ***************************.fct_visits visits_source_src_10011 - ) subq_22 + ) subq_21 INNER JOIN ( -- Read Elements From Semantic Model 'buys_source' -- Metric Time Dimension 'ds' -- Add column with generated UUID - -- Pass Only Elements: - -- ['buys', 'mf_internal_uuid'] SELECT - 1 AS buys + DATE_TRUNC('day', ds) AS ds__day + , user_id AS user + , 1 AS buys , GEN_RANDOM_UUID() AS mf_internal_uuid FROM ***************************.fct_buys buys_source_src_10002 - ) subq_26 + ) subq_24 ON ( - subq_22.user = subq_26.user + subq_21.user = subq_24.user ) AND ( ( - subq_22.ds__day <= subq_26.ds__day + subq_21.ds__day <= subq_24.ds__day ) AND ( - subq_22.ds__day > subq_26.ds__day - INTERVAL 7 day + subq_21.ds__day > subq_24.ds__day - INTERVAL 7 day ) ) - ) subq_27 + ) subq_25 GROUP BY visit__referrer_id - ) subq_30 + ) subq_28 ON - subq_19.visit__referrer_id = subq_30.visit__referrer_id + subq_18.visit__referrer_id = subq_28.visit__referrer_id GROUP BY - COALESCE(subq_19.visit__referrer_id, subq_30.visit__referrer_id) -) subq_31 + COALESCE(subq_18.visit__referrer_id, subq_28.visit__referrer_id) +) subq_29 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimension_with_joined_where_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimension_with_joined_where_constraint__plan0.sql index 111ca3665f..7a9740ce87 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimension_with_joined_where_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimension_with_joined_where_constraint__plan0.sql @@ -126,62 +126,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 FULL OUTER JOIN ( -- Pass Only Elements: @@ -192,32 +192,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy - , users_latest_src_10008.home_state_latest - , DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS user__ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds_latest__extract_doy - , 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 + DATE_TRUNC('day', users_latest_src_10009.ds) AS ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS ds_latest__extract_doy + , users_latest_src_10009.home_state_latest + , DATE_TRUNC('day', users_latest_src_10009.ds) AS user__ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS user__ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS user__ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS user__ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS user__ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS user__ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS user__ds_latest__extract_doy + , 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 ) subq_1 ) subq_2 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimension_with_joined_where_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimension_with_joined_where_constraint__plan0_optimized.sql index 28fb7a0251..bbb933bac0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimension_with_joined_where_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimension_with_joined_where_constraint__plan0_optimized.sql @@ -6,13 +6,13 @@ SELECT FROM ( -- Join Standard Outputs SELECT - listings_latest_src_10004.country AS listing__country_latest - , users_latest_src_10008.home_state_latest AS user__home_state_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + listings_latest_src_10005.country AS listing__country_latest + , users_latest_src_10009.home_state_latest AS user__home_state_latest + FROM ***************************.dim_listings_latest listings_latest_src_10005 FULL OUTER JOIN - ***************************.dim_users_latest users_latest_src_10008 + ***************************.dim_users_latest users_latest_src_10009 ON - listings_latest_src_10004.user_id = users_latest_src_10008.user_id + listings_latest_src_10005.user_id = users_latest_src_10009.user_id ) subq_8 WHERE listing__country_latest = 'us' GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0.sql index 4ffc0ed119..dd31fb79f8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0.sql @@ -67,62 +67,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 FULL OUTER JOIN ( -- Pass Only Elements: @@ -133,32 +133,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy - , users_latest_src_10008.home_state_latest - , DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS user__ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds_latest__extract_doy - , 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 + DATE_TRUNC('day', users_latest_src_10009.ds) AS ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS ds_latest__extract_doy + , users_latest_src_10009.home_state_latest + , DATE_TRUNC('day', users_latest_src_10009.ds) AS user__ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS user__ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS user__ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS user__ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS user__ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS user__ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS user__ds_latest__extract_doy + , 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 ) subq_1 ) subq_2 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0_optimized.sql index 4bf3539984..7f093b6070 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0_optimized.sql @@ -2,13 +2,13 @@ -- Pass Only Elements: -- ['user__home_state_latest', 'listing__is_lux_latest'] SELECT - listings_latest_src_10004.is_lux AS listing__is_lux_latest - , users_latest_src_10008.home_state_latest AS user__home_state_latest -FROM ***************************.dim_listings_latest listings_latest_src_10004 + listings_latest_src_10005.is_lux AS listing__is_lux_latest + , users_latest_src_10009.home_state_latest AS user__home_state_latest +FROM ***************************.dim_listings_latest listings_latest_src_10005 FULL OUTER JOIN - ***************************.dim_users_latest users_latest_src_10008 + ***************************.dim_users_latest users_latest_src_10009 ON - listings_latest_src_10004.user_id = users_latest_src_10008.user_id + listings_latest_src_10005.user_id = users_latest_src_10009.user_id GROUP BY - listings_latest_src_10004.is_lux - , users_latest_src_10008.home_state_latest + listings_latest_src_10005.is_lux + , users_latest_src_10009.home_state_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql index 5c1795fec6..63e1d67013 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql @@ -114,62 +114,62 @@ LEFT OUTER JOIN ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 @@ -184,62 +184,62 @@ LEFT OUTER JOIN ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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/DuckDB/test_multi_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0_optimized.sql index 8180d208b3..ddfc1d9706 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0_optimized.sql @@ -20,7 +20,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 @@ -31,7 +31,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/DuckDB/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql index 749b06ce93..ee2699fd60 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql @@ -112,62 +112,62 @@ LEFT OUTER JOIN ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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/DuckDB/test_single_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0_optimized.sql index 480a2c9f56..9202940446 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0_optimized.sql @@ -12,6 +12,6 @@ FROM ( FROM ***************************.fct_bookings 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/Postgres/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0.sql index 8acd57a67f..b46218bd01 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0.sql @@ -125,62 +125,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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/Postgres/test_compute_metrics_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0_optimized.sql index 7a53d1c84e..9e5210f489 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/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 Semantic Model 'bookings_source' @@ -15,9 +15,9 @@ FROM ( FROM ***************************.fct_bookings 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/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 0bcc2c8877..da83576f65 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -319,62 +319,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 @@ -487,55 +487,55 @@ FROM ( -- Read Elements From Semantic Model 'views_source' SELECT 1 AS views - , DATE_TRUNC('day', views_source_src_10009.ds) AS ds__day - , 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 - , EXTRACT(year FROM views_source_src_10009.ds) AS ds__extract_year - , EXTRACT(quarter FROM views_source_src_10009.ds) AS ds__extract_quarter - , EXTRACT(month FROM views_source_src_10009.ds) AS ds__extract_month - , EXTRACT(day FROM views_source_src_10009.ds) AS ds__extract_day - , EXTRACT(isodow FROM views_source_src_10009.ds) AS ds__extract_dow - , EXTRACT(doy FROM views_source_src_10009.ds) AS ds__extract_doy - , DATE_TRUNC('day', views_source_src_10009.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy - , DATE_TRUNC('day', views_source_src_10009.ds) AS view__ds__day - , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week - , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month - , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter - , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year - , EXTRACT(year FROM views_source_src_10009.ds) AS view__ds__extract_year - , EXTRACT(quarter FROM views_source_src_10009.ds) AS view__ds__extract_quarter - , EXTRACT(month FROM views_source_src_10009.ds) AS view__ds__extract_month - , EXTRACT(day FROM views_source_src_10009.ds) AS view__ds__extract_day - , EXTRACT(isodow FROM views_source_src_10009.ds) AS view__ds__extract_dow - , EXTRACT(doy FROM views_source_src_10009.ds) AS view__ds__extract_doy - , DATE_TRUNC('day', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__day - , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week - , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month - , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter - , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year - , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year - , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter - , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month - , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day - , EXTRACT(isodow FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow - , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy - , views_source_src_10009.listing_id AS listing - , views_source_src_10009.user_id AS user - , views_source_src_10009.listing_id AS view__listing - , views_source_src_10009.user_id AS view__user - FROM ***************************.fct_views views_source_src_10009 + , DATE_TRUNC('day', views_source_src_10010.ds) AS ds__day + , 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 + , EXTRACT(year FROM views_source_src_10010.ds) AS ds__extract_year + , EXTRACT(quarter FROM views_source_src_10010.ds) AS ds__extract_quarter + , EXTRACT(month FROM views_source_src_10010.ds) AS ds__extract_month + , EXTRACT(day FROM views_source_src_10010.ds) AS ds__extract_day + , EXTRACT(isodow FROM views_source_src_10010.ds) AS ds__extract_dow + , EXTRACT(doy FROM views_source_src_10010.ds) AS ds__extract_doy + , DATE_TRUNC('day', views_source_src_10010.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10010.ds_partitioned) AS ds_partitioned__extract_doy + , DATE_TRUNC('day', views_source_src_10010.ds) AS view__ds__day + , DATE_TRUNC('week', views_source_src_10010.ds) AS view__ds__week + , DATE_TRUNC('month', views_source_src_10010.ds) AS view__ds__month + , DATE_TRUNC('quarter', views_source_src_10010.ds) AS view__ds__quarter + , DATE_TRUNC('year', views_source_src_10010.ds) AS view__ds__year + , EXTRACT(year FROM views_source_src_10010.ds) AS view__ds__extract_year + , EXTRACT(quarter FROM views_source_src_10010.ds) AS view__ds__extract_quarter + , EXTRACT(month FROM views_source_src_10010.ds) AS view__ds__extract_month + , EXTRACT(day FROM views_source_src_10010.ds) AS view__ds__extract_day + , EXTRACT(isodow FROM views_source_src_10010.ds) AS view__ds__extract_dow + , EXTRACT(doy FROM views_source_src_10010.ds) AS view__ds__extract_doy + , DATE_TRUNC('day', views_source_src_10010.ds_partitioned) AS view__ds_partitioned__day + , DATE_TRUNC('week', views_source_src_10010.ds_partitioned) AS view__ds_partitioned__week + , DATE_TRUNC('month', views_source_src_10010.ds_partitioned) AS view__ds_partitioned__month + , DATE_TRUNC('quarter', views_source_src_10010.ds_partitioned) AS view__ds_partitioned__quarter + , DATE_TRUNC('year', views_source_src_10010.ds_partitioned) AS view__ds_partitioned__year + , EXTRACT(year FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(day FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(isodow FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10010.ds_partitioned) AS view__ds_partitioned__extract_doy + , views_source_src_10010.listing_id AS listing + , views_source_src_10010.user_id AS user + , views_source_src_10010.listing_id AS view__listing + , views_source_src_10010.user_id AS view__user + FROM ***************************.fct_views views_source_src_10010 ) subq_10 ) subq_11 ) subq_12 @@ -619,62 +619,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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_13 ) subq_14 ) subq_15 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0_optimized.sql index 63f6522655..172693949e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0_optimized.sql @@ -18,7 +18,7 @@ FROM ( -- Compute Metrics via Expressions SELECT subq_23.ds__day AS ds__day - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_23.bookings) AS bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -32,12 +32,12 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_10001 ) subq_23 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_23.listing = listings_latest_src_10004.listing_id + subq_23.listing = listings_latest_src_10005.listing_id GROUP BY subq_23.ds__day - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_30 FULL OUTER JOIN ( -- Join Standard Outputs @@ -47,7 +47,7 @@ FROM ( -- Compute Metrics via Expressions SELECT subq_33.ds__day AS ds__day - , listings_latest_src_10004.country AS listing__country_latest + , listings_latest_src_10005.country AS listing__country_latest , SUM(subq_33.views) AS views FROM ( -- Read Elements From Semantic Model 'views_source' @@ -58,15 +58,15 @@ FROM ( DATE_TRUNC('day', ds) AS ds__day , listing_id AS listing , 1 AS views - FROM ***************************.fct_views views_source_src_10009 + FROM ***************************.fct_views views_source_src_10010 ) subq_33 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_33.listing = listings_latest_src_10004.listing_id + subq_33.listing = listings_latest_src_10005.listing_id GROUP BY subq_33.ds__day - , listings_latest_src_10004.country + , listings_latest_src_10005.country ) subq_40 ON ( diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index be4f95db6e..8f5047e0a2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -128,62 +128,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0_optimized.sql index f4983187c4..340d8adf0a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__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 ( @@ -22,10 +22,10 @@ FROM ( FROM ***************************.fct_bookings 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/Postgres/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0.sql index f04f16e5bf..7bbc7fb3b9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0.sql @@ -125,62 +125,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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/Postgres/test_compute_metrics_node_simple_expr__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0_optimized.sql index caa4c0c6fe..5a844f2632 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0_optimized.sql @@ -8,14 +8,14 @@ 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 ***************************.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/Postgres/test_conversion_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_conversion_metric__plan0.sql new file mode 100644 index 0000000000..104495f656 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_conversion_metric__plan0.sql @@ -0,0 +1,363 @@ +-- Compute Metrics via Expressions +SELECT + subq_14.visit__referrer_id + , CAST(subq_14.buys AS DOUBLE PRECISION) / CAST(NULLIF(subq_14.visits, 0) AS DOUBLE PRECISION) AS visit_buy_conversion_rate +FROM ( + -- Combine Aggregated Outputs + SELECT + COALESCE(subq_3.visit__referrer_id, subq_13.visit__referrer_id) AS visit__referrer_id + , MAX(subq_3.visits) AS visits + , MAX(subq_13.buys) AS buys + FROM ( + -- Aggregate Measures + SELECT + subq_2.visit__referrer_id + , SUM(subq_2.visits) AS visits + FROM ( + -- Pass Only Elements: + -- ['visits', 'visit__referrer_id'] + SELECT + subq_1.visit__referrer_id + , subq_1.visits + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.visit__ds__day + , subq_0.visit__ds__week + , subq_0.visit__ds__month + , subq_0.visit__ds__quarter + , subq_0.visit__ds__year + , subq_0.visit__ds__extract_year + , subq_0.visit__ds__extract_quarter + , subq_0.visit__ds__extract_month + , subq_0.visit__ds__extract_day + , subq_0.visit__ds__extract_dow + , subq_0.visit__ds__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.user + , subq_0.session + , subq_0.visit__user + , subq_0.visit__session + , subq_0.referrer_id + , subq_0.visit__referrer_id + , subq_0.visits + , subq_0.visitors + FROM ( + -- Read Elements From Semantic Model 'visits_source' + SELECT + 1 AS visits + , visits_source_src_10011.user_id AS visitors + , DATE_TRUNC('day', visits_source_src_10011.ds) AS ds__day + , 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 + , EXTRACT(year FROM visits_source_src_10011.ds) AS ds__extract_year + , EXTRACT(quarter FROM visits_source_src_10011.ds) AS ds__extract_quarter + , EXTRACT(month FROM visits_source_src_10011.ds) AS ds__extract_month + , EXTRACT(day FROM visits_source_src_10011.ds) AS ds__extract_day + , EXTRACT(isodow FROM visits_source_src_10011.ds) AS ds__extract_dow + , EXTRACT(doy FROM visits_source_src_10011.ds) AS ds__extract_doy + , visits_source_src_10011.referrer_id + , DATE_TRUNC('day', visits_source_src_10011.ds) AS visit__ds__day + , DATE_TRUNC('week', visits_source_src_10011.ds) AS visit__ds__week + , DATE_TRUNC('month', visits_source_src_10011.ds) AS visit__ds__month + , DATE_TRUNC('quarter', visits_source_src_10011.ds) AS visit__ds__quarter + , DATE_TRUNC('year', visits_source_src_10011.ds) AS visit__ds__year + , EXTRACT(year FROM visits_source_src_10011.ds) AS visit__ds__extract_year + , EXTRACT(quarter FROM visits_source_src_10011.ds) AS visit__ds__extract_quarter + , EXTRACT(month FROM visits_source_src_10011.ds) AS visit__ds__extract_month + , EXTRACT(day FROM visits_source_src_10011.ds) AS visit__ds__extract_day + , EXTRACT(isodow FROM visits_source_src_10011.ds) AS visit__ds__extract_dow + , EXTRACT(doy FROM visits_source_src_10011.ds) AS visit__ds__extract_doy + , visits_source_src_10011.referrer_id AS visit__referrer_id + , visits_source_src_10011.user_id AS user + , visits_source_src_10011.session_id AS session + , visits_source_src_10011.user_id AS visit__user + , visits_source_src_10011.session_id AS visit__session + FROM ***************************.fct_visits visits_source_src_10011 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.visit__referrer_id + ) subq_3 + FULL OUTER JOIN ( + -- Aggregate Measures + SELECT + subq_12.visit__referrer_id + , SUM(subq_12.buys) AS buys + FROM ( + -- Pass Only Elements: + -- ['buys', 'visit__referrer_id'] + SELECT + subq_11.visit__referrer_id + , subq_11.buys + FROM ( + -- Find conversions for EntitySpec(element_name='user', entity_links=()) within the range of count=7 granularity=TimeGranularity.DAY + SELECT + subq_10.ds__day + , subq_10.user + , subq_10.visit__referrer_id + , subq_10.buys + , subq_10.visits + FROM ( + -- Dedupe the fanout on (MetadataSpec(element_name='mf_internal_uuid'),) in the conversion data set + SELECT DISTINCT + first_value(subq_6.visits) OVER (PARTITION BY subq_9.user, subq_9.ds__day, subq_9.mf_internal_uuid ORDER BY subq_6.ds__day DESC) AS visits + , first_value(subq_6.visit__referrer_id) OVER (PARTITION BY subq_9.user, subq_9.ds__day, subq_9.mf_internal_uuid ORDER BY subq_6.ds__day DESC) AS visit__referrer_id + , first_value(subq_6.ds__day) OVER (PARTITION BY subq_9.user, subq_9.ds__day, subq_9.mf_internal_uuid ORDER BY subq_6.ds__day DESC) AS ds__day + , first_value(subq_6.user) OVER (PARTITION BY subq_9.user, subq_9.ds__day, subq_9.mf_internal_uuid ORDER BY subq_6.ds__day DESC) AS user + , subq_9.mf_internal_uuid AS mf_internal_uuid + , subq_9.buys AS buys + FROM ( + -- Pass Only Elements: + -- ['visits', 'visit__referrer_id', 'ds__day', 'user'] + SELECT + subq_5.ds__day + , subq_5.user + , subq_5.visit__referrer_id + , subq_5.visits + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_4.ds__day + , subq_4.ds__week + , subq_4.ds__month + , subq_4.ds__quarter + , subq_4.ds__year + , subq_4.ds__extract_year + , subq_4.ds__extract_quarter + , subq_4.ds__extract_month + , subq_4.ds__extract_day + , subq_4.ds__extract_dow + , subq_4.ds__extract_doy + , subq_4.visit__ds__day + , subq_4.visit__ds__week + , subq_4.visit__ds__month + , subq_4.visit__ds__quarter + , subq_4.visit__ds__year + , subq_4.visit__ds__extract_year + , subq_4.visit__ds__extract_quarter + , subq_4.visit__ds__extract_month + , subq_4.visit__ds__extract_day + , subq_4.visit__ds__extract_dow + , subq_4.visit__ds__extract_doy + , subq_4.ds__day AS metric_time__day + , subq_4.ds__week AS metric_time__week + , subq_4.ds__month AS metric_time__month + , subq_4.ds__quarter AS metric_time__quarter + , subq_4.ds__year AS metric_time__year + , subq_4.ds__extract_year AS metric_time__extract_year + , subq_4.ds__extract_quarter AS metric_time__extract_quarter + , subq_4.ds__extract_month AS metric_time__extract_month + , subq_4.ds__extract_day AS metric_time__extract_day + , subq_4.ds__extract_dow AS metric_time__extract_dow + , subq_4.ds__extract_doy AS metric_time__extract_doy + , subq_4.user + , subq_4.session + , subq_4.visit__user + , subq_4.visit__session + , subq_4.referrer_id + , subq_4.visit__referrer_id + , subq_4.visits + , subq_4.visitors + FROM ( + -- Read Elements From Semantic Model 'visits_source' + SELECT + 1 AS visits + , visits_source_src_10011.user_id AS visitors + , DATE_TRUNC('day', visits_source_src_10011.ds) AS ds__day + , 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 + , EXTRACT(year FROM visits_source_src_10011.ds) AS ds__extract_year + , EXTRACT(quarter FROM visits_source_src_10011.ds) AS ds__extract_quarter + , EXTRACT(month FROM visits_source_src_10011.ds) AS ds__extract_month + , EXTRACT(day FROM visits_source_src_10011.ds) AS ds__extract_day + , EXTRACT(isodow FROM visits_source_src_10011.ds) AS ds__extract_dow + , EXTRACT(doy FROM visits_source_src_10011.ds) AS ds__extract_doy + , visits_source_src_10011.referrer_id + , DATE_TRUNC('day', visits_source_src_10011.ds) AS visit__ds__day + , DATE_TRUNC('week', visits_source_src_10011.ds) AS visit__ds__week + , DATE_TRUNC('month', visits_source_src_10011.ds) AS visit__ds__month + , DATE_TRUNC('quarter', visits_source_src_10011.ds) AS visit__ds__quarter + , DATE_TRUNC('year', visits_source_src_10011.ds) AS visit__ds__year + , EXTRACT(year FROM visits_source_src_10011.ds) AS visit__ds__extract_year + , EXTRACT(quarter FROM visits_source_src_10011.ds) AS visit__ds__extract_quarter + , EXTRACT(month FROM visits_source_src_10011.ds) AS visit__ds__extract_month + , EXTRACT(day FROM visits_source_src_10011.ds) AS visit__ds__extract_day + , EXTRACT(isodow FROM visits_source_src_10011.ds) AS visit__ds__extract_dow + , EXTRACT(doy FROM visits_source_src_10011.ds) AS visit__ds__extract_doy + , visits_source_src_10011.referrer_id AS visit__referrer_id + , visits_source_src_10011.user_id AS user + , visits_source_src_10011.session_id AS session + , visits_source_src_10011.user_id AS visit__user + , visits_source_src_10011.session_id AS visit__session + FROM ***************************.fct_visits visits_source_src_10011 + ) subq_4 + ) subq_5 + ) subq_6 + INNER JOIN ( + -- Add column with generated UUID + SELECT + subq_8.ds__day + , subq_8.ds__week + , subq_8.ds__month + , subq_8.ds__quarter + , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_day + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy + , subq_8.buy__ds__day + , subq_8.buy__ds__week + , subq_8.buy__ds__month + , subq_8.buy__ds__quarter + , subq_8.buy__ds__year + , subq_8.buy__ds__extract_year + , subq_8.buy__ds__extract_quarter + , subq_8.buy__ds__extract_month + , subq_8.buy__ds__extract_day + , subq_8.buy__ds__extract_dow + , subq_8.buy__ds__extract_doy + , subq_8.metric_time__day + , subq_8.metric_time__week + , subq_8.metric_time__month + , subq_8.metric_time__quarter + , subq_8.metric_time__year + , subq_8.metric_time__extract_year + , subq_8.metric_time__extract_quarter + , subq_8.metric_time__extract_month + , subq_8.metric_time__extract_day + , subq_8.metric_time__extract_dow + , subq_8.metric_time__extract_doy + , subq_8.user + , subq_8.session_id + , subq_8.buy__user + , subq_8.buy__session_id + , subq_8.buys + , subq_8.buyers + , GEN_RANDOM_UUID() AS mf_internal_uuid + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_7.ds__day + , subq_7.ds__week + , subq_7.ds__month + , subq_7.ds__quarter + , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_day + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy + , subq_7.buy__ds__day + , subq_7.buy__ds__week + , subq_7.buy__ds__month + , subq_7.buy__ds__quarter + , subq_7.buy__ds__year + , subq_7.buy__ds__extract_year + , subq_7.buy__ds__extract_quarter + , subq_7.buy__ds__extract_month + , subq_7.buy__ds__extract_day + , subq_7.buy__ds__extract_dow + , subq_7.buy__ds__extract_doy + , subq_7.ds__day AS metric_time__day + , subq_7.ds__week AS metric_time__week + , subq_7.ds__month AS metric_time__month + , subq_7.ds__quarter AS metric_time__quarter + , subq_7.ds__year AS metric_time__year + , subq_7.ds__extract_year AS metric_time__extract_year + , subq_7.ds__extract_quarter AS metric_time__extract_quarter + , subq_7.ds__extract_month AS metric_time__extract_month + , subq_7.ds__extract_day AS metric_time__extract_day + , subq_7.ds__extract_dow AS metric_time__extract_dow + , subq_7.ds__extract_doy AS metric_time__extract_doy + , subq_7.user + , subq_7.session_id + , subq_7.buy__user + , subq_7.buy__session_id + , subq_7.buys + , subq_7.buyers + FROM ( + -- Read Elements From Semantic Model 'buys_source' + SELECT + 1 AS buys + , buys_source_src_10002.user_id AS buyers + , DATE_TRUNC('day', buys_source_src_10002.ds) AS ds__day + , 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 + , EXTRACT(year FROM buys_source_src_10002.ds) AS ds__extract_year + , EXTRACT(quarter FROM buys_source_src_10002.ds) AS ds__extract_quarter + , EXTRACT(month FROM buys_source_src_10002.ds) AS ds__extract_month + , EXTRACT(day FROM buys_source_src_10002.ds) AS ds__extract_day + , EXTRACT(isodow FROM buys_source_src_10002.ds) AS ds__extract_dow + , EXTRACT(doy FROM buys_source_src_10002.ds) AS ds__extract_doy + , DATE_TRUNC('day', buys_source_src_10002.ds) AS buy__ds__day + , DATE_TRUNC('week', buys_source_src_10002.ds) AS buy__ds__week + , DATE_TRUNC('month', buys_source_src_10002.ds) AS buy__ds__month + , DATE_TRUNC('quarter', buys_source_src_10002.ds) AS buy__ds__quarter + , DATE_TRUNC('year', buys_source_src_10002.ds) AS buy__ds__year + , EXTRACT(year FROM buys_source_src_10002.ds) AS buy__ds__extract_year + , EXTRACT(quarter FROM buys_source_src_10002.ds) AS buy__ds__extract_quarter + , EXTRACT(month FROM buys_source_src_10002.ds) AS buy__ds__extract_month + , EXTRACT(day FROM buys_source_src_10002.ds) AS buy__ds__extract_day + , EXTRACT(isodow FROM buys_source_src_10002.ds) AS buy__ds__extract_dow + , EXTRACT(doy FROM buys_source_src_10002.ds) AS buy__ds__extract_doy + , buys_source_src_10002.user_id AS user + , buys_source_src_10002.session_id + , buys_source_src_10002.user_id AS buy__user + , buys_source_src_10002.session_id AS buy__session_id + FROM ***************************.fct_buys buys_source_src_10002 + ) subq_7 + ) subq_8 + ) subq_9 + ON + ( + subq_6.user = subq_9.user + ) AND ( + ( + subq_6.ds__day <= subq_9.ds__day + ) AND ( + subq_6.ds__day > subq_9.ds__day - MAKE_INTERVAL(days => 7) + ) + ) + ) subq_10 + ) subq_11 + ) subq_12 + GROUP BY + subq_12.visit__referrer_id + ) subq_13 + ON + subq_3.visit__referrer_id = subq_13.visit__referrer_id + GROUP BY + COALESCE(subq_3.visit__referrer_id, subq_13.visit__referrer_id) +) subq_14 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_conversion_metric__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_conversion_metric__plan0_optimized.sql new file mode 100644 index 0000000000..50d573bb4e --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_conversion_metric__plan0_optimized.sql @@ -0,0 +1,87 @@ +-- Compute Metrics via Expressions +SELECT + visit__referrer_id + , CAST(buys AS DOUBLE PRECISION) / CAST(NULLIF(visits, 0) AS DOUBLE PRECISION) AS visit_buy_conversion_rate +FROM ( + -- Combine Aggregated Outputs + SELECT + COALESCE(subq_18.visit__referrer_id, subq_28.visit__referrer_id) AS visit__referrer_id + , MAX(subq_18.visits) AS visits + , MAX(subq_28.buys) AS buys + FROM ( + -- Aggregate Measures + SELECT + visit__referrer_id + , SUM(visits) AS visits + FROM ( + -- Read Elements From Semantic Model 'visits_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['visits', 'visit__referrer_id'] + SELECT + referrer_id AS visit__referrer_id + , 1 AS visits + FROM ***************************.fct_visits visits_source_src_10011 + ) subq_17 + GROUP BY + visit__referrer_id + ) subq_18 + FULL OUTER JOIN ( + -- Find conversions for EntitySpec(element_name='user', entity_links=()) within the range of count=7 granularity=TimeGranularity.DAY + -- Pass Only Elements: + -- ['buys', 'visit__referrer_id'] + -- Aggregate Measures + SELECT + visit__referrer_id + , SUM(buys) AS buys + FROM ( + -- Dedupe the fanout on (MetadataSpec(element_name='mf_internal_uuid'),) in the conversion data set + SELECT DISTINCT + first_value(subq_21.visits) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC) AS visits + , first_value(subq_21.visit__referrer_id) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC) AS visit__referrer_id + , first_value(subq_21.ds__day) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC) AS ds__day + , first_value(subq_21.user) OVER (PARTITION BY subq_24.user, subq_24.ds__day, subq_24.mf_internal_uuid ORDER BY subq_21.ds__day DESC) AS user + , subq_24.mf_internal_uuid AS mf_internal_uuid + , subq_24.buys AS buys + FROM ( + -- Read Elements From Semantic Model 'visits_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['visits', 'visit__referrer_id', 'ds__day', 'user'] + SELECT + DATE_TRUNC('day', ds) AS ds__day + , user_id AS user + , referrer_id AS visit__referrer_id + , 1 AS visits + FROM ***************************.fct_visits visits_source_src_10011 + ) subq_21 + INNER JOIN ( + -- Read Elements From Semantic Model 'buys_source' + -- Metric Time Dimension 'ds' + -- Add column with generated UUID + SELECT + DATE_TRUNC('day', ds) AS ds__day + , user_id AS user + , 1 AS buys + , GEN_RANDOM_UUID() AS mf_internal_uuid + FROM ***************************.fct_buys buys_source_src_10002 + ) subq_24 + ON + ( + subq_21.user = subq_24.user + ) AND ( + ( + subq_21.ds__day <= subq_24.ds__day + ) AND ( + subq_21.ds__day > subq_24.ds__day - MAKE_INTERVAL(days => 7) + ) + ) + ) subq_25 + GROUP BY + visit__referrer_id + ) subq_28 + ON + subq_18.visit__referrer_id = subq_28.visit__referrer_id + GROUP BY + COALESCE(subq_18.visit__referrer_id, subq_28.visit__referrer_id) +) subq_29 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimension_with_joined_where_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimension_with_joined_where_constraint__plan0.sql index 111ca3665f..7a9740ce87 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimension_with_joined_where_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimension_with_joined_where_constraint__plan0.sql @@ -126,62 +126,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 FULL OUTER JOIN ( -- Pass Only Elements: @@ -192,32 +192,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy - , users_latest_src_10008.home_state_latest - , DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS user__ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds_latest__extract_doy - , 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 + DATE_TRUNC('day', users_latest_src_10009.ds) AS ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS ds_latest__extract_doy + , users_latest_src_10009.home_state_latest + , DATE_TRUNC('day', users_latest_src_10009.ds) AS user__ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS user__ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS user__ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS user__ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS user__ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS user__ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS user__ds_latest__extract_doy + , 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 ) subq_1 ) subq_2 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimension_with_joined_where_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimension_with_joined_where_constraint__plan0_optimized.sql index 28fb7a0251..bbb933bac0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimension_with_joined_where_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimension_with_joined_where_constraint__plan0_optimized.sql @@ -6,13 +6,13 @@ SELECT FROM ( -- Join Standard Outputs SELECT - listings_latest_src_10004.country AS listing__country_latest - , users_latest_src_10008.home_state_latest AS user__home_state_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + listings_latest_src_10005.country AS listing__country_latest + , users_latest_src_10009.home_state_latest AS user__home_state_latest + FROM ***************************.dim_listings_latest listings_latest_src_10005 FULL OUTER JOIN - ***************************.dim_users_latest users_latest_src_10008 + ***************************.dim_users_latest users_latest_src_10009 ON - listings_latest_src_10004.user_id = users_latest_src_10008.user_id + listings_latest_src_10005.user_id = users_latest_src_10009.user_id ) subq_8 WHERE listing__country_latest = 'us' GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0.sql index 4ffc0ed119..dd31fb79f8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0.sql @@ -67,62 +67,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 FULL OUTER JOIN ( -- Pass Only Elements: @@ -133,32 +133,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy - , users_latest_src_10008.home_state_latest - , DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS user__ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds_latest__extract_doy - , 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 + DATE_TRUNC('day', users_latest_src_10009.ds) AS ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS ds_latest__extract_doy + , users_latest_src_10009.home_state_latest + , DATE_TRUNC('day', users_latest_src_10009.ds) AS user__ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS user__ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS user__ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS user__ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS user__ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS user__ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS user__ds_latest__extract_doy + , 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 ) subq_1 ) subq_2 ON diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0_optimized.sql index 4bf3539984..7f093b6070 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0_optimized.sql @@ -2,13 +2,13 @@ -- Pass Only Elements: -- ['user__home_state_latest', 'listing__is_lux_latest'] SELECT - listings_latest_src_10004.is_lux AS listing__is_lux_latest - , users_latest_src_10008.home_state_latest AS user__home_state_latest -FROM ***************************.dim_listings_latest listings_latest_src_10004 + listings_latest_src_10005.is_lux AS listing__is_lux_latest + , users_latest_src_10009.home_state_latest AS user__home_state_latest +FROM ***************************.dim_listings_latest listings_latest_src_10005 FULL OUTER JOIN - ***************************.dim_users_latest users_latest_src_10008 + ***************************.dim_users_latest users_latest_src_10009 ON - listings_latest_src_10004.user_id = users_latest_src_10008.user_id + listings_latest_src_10005.user_id = users_latest_src_10009.user_id GROUP BY - listings_latest_src_10004.is_lux - , users_latest_src_10008.home_state_latest + listings_latest_src_10005.is_lux + , users_latest_src_10009.home_state_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql index 5c1795fec6..63e1d67013 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql @@ -114,62 +114,62 @@ LEFT OUTER JOIN ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 @@ -184,62 +184,62 @@ LEFT OUTER JOIN ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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/Postgres/test_multi_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0_optimized.sql index 8180d208b3..ddfc1d9706 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0_optimized.sql @@ -20,7 +20,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 @@ -31,7 +31,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/Postgres/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0.sql index 749b06ce93..ee2699fd60 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0.sql @@ -112,62 +112,62 @@ LEFT OUTER JOIN ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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/Postgres/test_single_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0_optimized.sql index 480a2c9f56..9202940446 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0_optimized.sql @@ -12,6 +12,6 @@ FROM ( FROM ***************************.fct_bookings 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_compute_metrics_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml index 77ef9e9b24..29122d902b 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 @@ -461,242 +461,242 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml index cc5132fbd1..3f3aecfe24 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml @@ -1,25 +1,25 @@ - + - + - + - + - + @@ -36,10 +36,10 @@ - + - + @@ -55,45 +55,45 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -101,45 +101,45 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -149,416 +149,416 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -933,525 +933,525 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1463,45 +1463,45 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -1509,45 +1509,45 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -1557,473 +1557,473 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -2033,525 +2033,525 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml index b8ea0e4a87..17c1855177 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml @@ -473,242 +473,242 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 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 d54260dadb..22bf057801 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 @@ -461,242 +461,242 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_conversion_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_conversion_metric__plan0.xml index ebfbf27b26..83e44cb058 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_conversion_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_conversion_metric__plan0.xml @@ -1,21 +1,21 @@ - + - + - + - - + + @@ -31,8 +31,8 @@ - - + + @@ -46,7 +46,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -66,11 +66,11 @@ - + - + @@ -80,159 +80,167 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - + + + + + + + + + @@ -246,7 +254,7 @@ - + @@ -294,7 +302,7 @@ - + @@ -342,16 +350,24 @@ - + - + - + + + + + + + + + @@ -366,19 +382,19 @@ - + - + - + - + @@ -386,41 +402,49 @@ - + - + - + - + - + - - + + - - + + - + + + + + + + + + - + - + @@ -429,35 +453,51 @@ - + + + + + + + + + - + - + - + - - + + - - - + + + - - + + - + + + + + + + + + @@ -467,159 +507,167 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - + + + + + + + + + @@ -633,7 +681,7 @@ - + @@ -681,7 +729,7 @@ - + @@ -729,16 +777,24 @@ - + - + - + + + + + + + + + @@ -751,449 +807,456 @@ - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + + + + + + + + + - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_dimension_with_joined_where_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_dimension_with_joined_where_constraint__plan0.xml index e20132aba5..c3eed73a7e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_dimension_with_joined_where_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_dimension_with_joined_where_constraint__plan0.xml @@ -481,7 +481,7 @@ - + @@ -492,237 +492,237 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -739,118 +739,118 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_dimensions_requiring_join__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_dimensions_requiring_join__plan0.xml index 1eb6447fb4..ad8b624b68 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_dimensions_requiring_join__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_dimensions_requiring_join__plan0.xml @@ -254,7 +254,7 @@ - + @@ -265,237 +265,237 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -512,118 +512,118 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 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 3268ab93ba..1c616c88c7 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 @@ -427,242 +427,242 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -680,242 +680,242 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 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 ab795d1fad..659424d6b3 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 @@ -413,242 +413,242 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql b/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql index 3e830e9a12..a3797a278c 100644 --- a/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql @@ -72,22 +72,22 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'bookings_monthly_source' SELECT - bookings_monthly_source_src_10024.bookings_monthly - , DATE_TRUNC('month', bookings_monthly_source_src_10024.ds) AS monthly_ds__month - , DATE_TRUNC('quarter', bookings_monthly_source_src_10024.ds) AS monthly_ds__quarter - , DATE_TRUNC('year', bookings_monthly_source_src_10024.ds) AS monthly_ds__year - , EXTRACT(year FROM bookings_monthly_source_src_10024.ds) AS monthly_ds__extract_year - , EXTRACT(quarter FROM bookings_monthly_source_src_10024.ds) AS monthly_ds__extract_quarter - , EXTRACT(month FROM bookings_monthly_source_src_10024.ds) AS monthly_ds__extract_month - , DATE_TRUNC('month', bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__month - , DATE_TRUNC('quarter', bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__quarter - , DATE_TRUNC('year', bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__year - , EXTRACT(year FROM bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__extract_year - , EXTRACT(quarter FROM bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__extract_quarter - , EXTRACT(month FROM bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__extract_month - , bookings_monthly_source_src_10024.listing_id AS listing - , bookings_monthly_source_src_10024.listing_id AS booking__listing - FROM ***************************.fct_bookings_extended_monthly bookings_monthly_source_src_10024 + bookings_monthly_source_src_10026.bookings_monthly + , DATE_TRUNC('month', bookings_monthly_source_src_10026.ds) AS monthly_ds__month + , DATE_TRUNC('quarter', bookings_monthly_source_src_10026.ds) AS monthly_ds__quarter + , DATE_TRUNC('year', bookings_monthly_source_src_10026.ds) AS monthly_ds__year + , EXTRACT(year FROM bookings_monthly_source_src_10026.ds) AS monthly_ds__extract_year + , EXTRACT(quarter FROM bookings_monthly_source_src_10026.ds) AS monthly_ds__extract_quarter + , EXTRACT(month FROM bookings_monthly_source_src_10026.ds) AS monthly_ds__extract_month + , DATE_TRUNC('month', bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__month + , DATE_TRUNC('quarter', bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__quarter + , DATE_TRUNC('year', bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__year + , EXTRACT(year FROM bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__extract_year + , EXTRACT(quarter FROM bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__extract_quarter + , EXTRACT(month FROM bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__extract_month + , bookings_monthly_source_src_10026.listing_id AS listing + , bookings_monthly_source_src_10026.listing_id AS booking__listing + FROM ***************************.fct_bookings_extended_monthly bookings_monthly_source_src_10026 ) subq_0 ) subq_1 ON diff --git a/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0_optimized.sql b/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0_optimized.sql index 4883e8870b..c462a58676 100644 --- a/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0_optimized.sql @@ -10,7 +10,7 @@ FROM ( -- Compute Metrics via Expressions SELECT subq_10.metric_time__month AS metric_time__month - , SUM(bookings_monthly_source_src_10024.bookings_monthly) AS bookings_last_month + , SUM(bookings_monthly_source_src_10026.bookings_monthly) AS bookings_last_month FROM ( -- Date Spine SELECT @@ -20,9 +20,9 @@ FROM ( DATE_TRUNC('month', ds) ) subq_10 INNER JOIN - ***************************.fct_bookings_extended_monthly bookings_monthly_source_src_10024 + ***************************.fct_bookings_extended_monthly bookings_monthly_source_src_10026 ON - subq_10.metric_time__month - INTERVAL 1 month = DATE_TRUNC('month', bookings_monthly_source_src_10024.ds) + subq_10.metric_time__month - INTERVAL 1 month = DATE_TRUNC('month', bookings_monthly_source_src_10026.ds) GROUP BY subq_10.metric_time__month ) subq_15 diff --git a/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql b/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql index 5a98441f07..c064e30cd1 100644 --- a/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql @@ -72,22 +72,22 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'bookings_monthly_source' SELECT - bookings_monthly_source_src_10024.bookings_monthly - , DATE_TRUNC('month', bookings_monthly_source_src_10024.ds) AS monthly_ds__month - , DATE_TRUNC('quarter', bookings_monthly_source_src_10024.ds) AS monthly_ds__quarter - , DATE_TRUNC('year', bookings_monthly_source_src_10024.ds) AS monthly_ds__year - , EXTRACT(year FROM bookings_monthly_source_src_10024.ds) AS monthly_ds__extract_year - , EXTRACT(quarter FROM bookings_monthly_source_src_10024.ds) AS monthly_ds__extract_quarter - , EXTRACT(month FROM bookings_monthly_source_src_10024.ds) AS monthly_ds__extract_month - , DATE_TRUNC('month', bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__month - , DATE_TRUNC('quarter', bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__quarter - , DATE_TRUNC('year', bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__year - , EXTRACT(year FROM bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__extract_year - , EXTRACT(quarter FROM bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__extract_quarter - , EXTRACT(month FROM bookings_monthly_source_src_10024.ds) AS booking__monthly_ds__extract_month - , bookings_monthly_source_src_10024.listing_id AS listing - , bookings_monthly_source_src_10024.listing_id AS booking__listing - FROM ***************************.fct_bookings_extended_monthly bookings_monthly_source_src_10024 + bookings_monthly_source_src_10026.bookings_monthly + , DATE_TRUNC('month', bookings_monthly_source_src_10026.ds) AS monthly_ds__month + , DATE_TRUNC('quarter', bookings_monthly_source_src_10026.ds) AS monthly_ds__quarter + , DATE_TRUNC('year', bookings_monthly_source_src_10026.ds) AS monthly_ds__year + , EXTRACT(year FROM bookings_monthly_source_src_10026.ds) AS monthly_ds__extract_year + , EXTRACT(quarter FROM bookings_monthly_source_src_10026.ds) AS monthly_ds__extract_quarter + , EXTRACT(month FROM bookings_monthly_source_src_10026.ds) AS monthly_ds__extract_month + , DATE_TRUNC('month', bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__month + , DATE_TRUNC('quarter', bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__quarter + , DATE_TRUNC('year', bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__year + , EXTRACT(year FROM bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__extract_year + , EXTRACT(quarter FROM bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__extract_quarter + , EXTRACT(month FROM bookings_monthly_source_src_10026.ds) AS booking__monthly_ds__extract_month + , bookings_monthly_source_src_10026.listing_id AS listing + , bookings_monthly_source_src_10026.listing_id AS booking__listing + FROM ***************************.fct_bookings_extended_monthly bookings_monthly_source_src_10026 ) subq_0 ) subq_1 ON diff --git a/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0_optimized.sql b/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0_optimized.sql index 519a319f9a..88420281f4 100644 --- a/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0_optimized.sql @@ -10,7 +10,7 @@ FROM ( -- Compute Metrics via Expressions SELECT subq_10.metric_time__month AS metric_time__month - , SUM(bookings_monthly_source_src_10024.bookings_monthly) AS bookings_last_month + , SUM(bookings_monthly_source_src_10026.bookings_monthly) AS bookings_last_month FROM ( -- Date Spine SELECT @@ -20,9 +20,9 @@ FROM ( DATE_TRUNC('month', ds) ) subq_10 INNER JOIN - ***************************.fct_bookings_extended_monthly bookings_monthly_source_src_10024 + ***************************.fct_bookings_extended_monthly bookings_monthly_source_src_10026 ON - subq_10.metric_time__month - MAKE_INTERVAL(months => 1) = DATE_TRUNC('month', bookings_monthly_source_src_10024.ds) + subq_10.metric_time__month - MAKE_INTERVAL(months => 1) = DATE_TRUNC('month', bookings_monthly_source_src_10026.ds) GROUP BY subq_10.metric_time__month ) subq_15 diff --git a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimension_values_with_a_join_and_a_filter__plan0.sql b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimension_values_with_a_join_and_a_filter__plan0.sql index 09d4611a5c..2574c8a32a 100644 --- a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimension_values_with_a_join_and_a_filter__plan0.sql +++ b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimension_values_with_a_join_and_a_filter__plan0.sql @@ -127,62 +127,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 FULL OUTER JOIN ( -- Pass Only Elements: @@ -193,32 +193,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy - , users_latest_src_10008.home_state_latest - , DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS user__ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds_latest__extract_doy - , 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 + DATE_TRUNC('day', users_latest_src_10009.ds) AS ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS ds_latest__extract_doy + , users_latest_src_10009.home_state_latest + , DATE_TRUNC('day', users_latest_src_10009.ds) AS user__ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS user__ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS user__ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS user__ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS user__ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS user__ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS user__ds_latest__extract_doy + , 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 ) subq_1 ) subq_2 ON diff --git a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimension_values_with_a_join_and_a_filter__plan0_optimized.sql b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimension_values_with_a_join_and_a_filter__plan0_optimized.sql index 3d0526ebb2..533b86774d 100644 --- a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimension_values_with_a_join_and_a_filter__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimension_values_with_a_join_and_a_filter__plan0_optimized.sql @@ -7,13 +7,13 @@ SELECT FROM ( -- Join Standard Outputs SELECT - listings_latest_src_10004.is_lux AS listing__is_lux_latest - , users_latest_src_10008.home_state_latest AS user__home_state_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + listings_latest_src_10005.is_lux AS listing__is_lux_latest + , users_latest_src_10009.home_state_latest AS user__home_state_latest + FROM ***************************.dim_listings_latest listings_latest_src_10005 FULL OUTER JOIN - ***************************.dim_users_latest users_latest_src_10008 + ***************************.dim_users_latest users_latest_src_10009 ON - listings_latest_src_10004.user_id = users_latest_src_10008.user_id + listings_latest_src_10005.user_id = users_latest_src_10009.user_id ) subq_8 WHERE user__home_state_latest = 'us' GROUP BY diff --git a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0.sql b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0.sql index 4ffc0ed119..dd31fb79f8 100644 --- a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0.sql +++ b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0.sql @@ -67,62 +67,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 FULL OUTER JOIN ( -- Pass Only Elements: @@ -133,32 +133,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy - , users_latest_src_10008.home_state_latest - , DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS user__ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds_latest__extract_doy - , 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 + DATE_TRUNC('day', users_latest_src_10009.ds) AS ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS ds_latest__extract_doy + , users_latest_src_10009.home_state_latest + , DATE_TRUNC('day', users_latest_src_10009.ds) AS user__ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS user__ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS user__ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS user__ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS user__ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS user__ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS user__ds_latest__extract_doy + , 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 ) subq_1 ) subq_2 ON diff --git a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0_optimized.sql b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0_optimized.sql index 4bf3539984..7f093b6070 100644 --- a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/DuckDB/test_dimensions_requiring_join__plan0_optimized.sql @@ -2,13 +2,13 @@ -- Pass Only Elements: -- ['user__home_state_latest', 'listing__is_lux_latest'] SELECT - listings_latest_src_10004.is_lux AS listing__is_lux_latest - , users_latest_src_10008.home_state_latest AS user__home_state_latest -FROM ***************************.dim_listings_latest listings_latest_src_10004 + listings_latest_src_10005.is_lux AS listing__is_lux_latest + , users_latest_src_10009.home_state_latest AS user__home_state_latest +FROM ***************************.dim_listings_latest listings_latest_src_10005 FULL OUTER JOIN - ***************************.dim_users_latest users_latest_src_10008 + ***************************.dim_users_latest users_latest_src_10009 ON - listings_latest_src_10004.user_id = users_latest_src_10008.user_id + listings_latest_src_10005.user_id = users_latest_src_10009.user_id GROUP BY - listings_latest_src_10004.is_lux - , users_latest_src_10008.home_state_latest + listings_latest_src_10005.is_lux + , users_latest_src_10009.home_state_latest diff --git a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimension_values_with_a_join_and_a_filter__plan0.sql b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimension_values_with_a_join_and_a_filter__plan0.sql index 09d4611a5c..2574c8a32a 100644 --- a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimension_values_with_a_join_and_a_filter__plan0.sql +++ b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimension_values_with_a_join_and_a_filter__plan0.sql @@ -127,62 +127,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 FULL OUTER JOIN ( -- Pass Only Elements: @@ -193,32 +193,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy - , users_latest_src_10008.home_state_latest - , DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS user__ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds_latest__extract_doy - , 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 + DATE_TRUNC('day', users_latest_src_10009.ds) AS ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS ds_latest__extract_doy + , users_latest_src_10009.home_state_latest + , DATE_TRUNC('day', users_latest_src_10009.ds) AS user__ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS user__ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS user__ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS user__ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS user__ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS user__ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS user__ds_latest__extract_doy + , 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 ) subq_1 ) subq_2 ON diff --git a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimension_values_with_a_join_and_a_filter__plan0_optimized.sql b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimension_values_with_a_join_and_a_filter__plan0_optimized.sql index 3d0526ebb2..533b86774d 100644 --- a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimension_values_with_a_join_and_a_filter__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimension_values_with_a_join_and_a_filter__plan0_optimized.sql @@ -7,13 +7,13 @@ SELECT FROM ( -- Join Standard Outputs SELECT - listings_latest_src_10004.is_lux AS listing__is_lux_latest - , users_latest_src_10008.home_state_latest AS user__home_state_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + listings_latest_src_10005.is_lux AS listing__is_lux_latest + , users_latest_src_10009.home_state_latest AS user__home_state_latest + FROM ***************************.dim_listings_latest listings_latest_src_10005 FULL OUTER JOIN - ***************************.dim_users_latest users_latest_src_10008 + ***************************.dim_users_latest users_latest_src_10009 ON - listings_latest_src_10004.user_id = users_latest_src_10008.user_id + listings_latest_src_10005.user_id = users_latest_src_10009.user_id ) subq_8 WHERE user__home_state_latest = 'us' GROUP BY diff --git a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0.sql b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0.sql index 4ffc0ed119..dd31fb79f8 100644 --- a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0.sql +++ b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0.sql @@ -67,62 +67,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 FULL OUTER JOIN ( -- Pass Only Elements: @@ -133,32 +133,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy - , users_latest_src_10008.home_state_latest - , DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day - , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week - , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month - , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter - , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds_latest__year - , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds_latest__extract_year - , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds_latest__extract_quarter - , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds_latest__extract_month - , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds_latest__extract_day - , EXTRACT(isodow FROM users_latest_src_10008.ds) AS user__ds_latest__extract_dow - , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds_latest__extract_doy - , 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 + DATE_TRUNC('day', users_latest_src_10009.ds) AS ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS ds_latest__extract_doy + , users_latest_src_10009.home_state_latest + , DATE_TRUNC('day', users_latest_src_10009.ds) AS user__ds_latest__day + , DATE_TRUNC('week', users_latest_src_10009.ds) AS user__ds_latest__week + , DATE_TRUNC('month', users_latest_src_10009.ds) AS user__ds_latest__month + , DATE_TRUNC('quarter', users_latest_src_10009.ds) AS user__ds_latest__quarter + , DATE_TRUNC('year', users_latest_src_10009.ds) AS user__ds_latest__year + , EXTRACT(year FROM users_latest_src_10009.ds) AS user__ds_latest__extract_year + , EXTRACT(quarter FROM users_latest_src_10009.ds) AS user__ds_latest__extract_quarter + , EXTRACT(month FROM users_latest_src_10009.ds) AS user__ds_latest__extract_month + , EXTRACT(day FROM users_latest_src_10009.ds) AS user__ds_latest__extract_day + , EXTRACT(isodow FROM users_latest_src_10009.ds) AS user__ds_latest__extract_dow + , EXTRACT(doy FROM users_latest_src_10009.ds) AS user__ds_latest__extract_doy + , 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 ) subq_1 ) subq_2 ON diff --git a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0_optimized.sql b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0_optimized.sql index 4bf3539984..7f093b6070 100644 --- a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/Postgres/test_dimensions_requiring_join__plan0_optimized.sql @@ -2,13 +2,13 @@ -- Pass Only Elements: -- ['user__home_state_latest', 'listing__is_lux_latest'] SELECT - listings_latest_src_10004.is_lux AS listing__is_lux_latest - , users_latest_src_10008.home_state_latest AS user__home_state_latest -FROM ***************************.dim_listings_latest listings_latest_src_10004 + listings_latest_src_10005.is_lux AS listing__is_lux_latest + , users_latest_src_10009.home_state_latest AS user__home_state_latest +FROM ***************************.dim_listings_latest listings_latest_src_10005 FULL OUTER JOIN - ***************************.dim_users_latest users_latest_src_10008 + ***************************.dim_users_latest users_latest_src_10009 ON - listings_latest_src_10004.user_id = users_latest_src_10008.user_id + listings_latest_src_10005.user_id = users_latest_src_10009.user_id GROUP BY - listings_latest_src_10004.is_lux - , users_latest_src_10008.home_state_latest + listings_latest_src_10005.is_lux + , users_latest_src_10009.home_state_latest diff --git a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/test_dimension_values_with_a_join_and_a_filter__plan0.xml b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/test_dimension_values_with_a_join_and_a_filter__plan0.xml index 26d712d0f6..c33124d380 100644 --- a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/test_dimension_values_with_a_join_and_a_filter__plan0.xml +++ b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/test_dimension_values_with_a_join_and_a_filter__plan0.xml @@ -489,7 +489,7 @@ - + @@ -500,237 +500,237 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -747,118 +747,118 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/test_dimensions_requiring_join__plan0.xml b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/test_dimensions_requiring_join__plan0.xml index 1eb6447fb4..ad8b624b68 100644 --- a/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/test_dimensions_requiring_join__plan0.xml +++ b/metricflow/test/snapshots/test_distinct_values_to_sql.py/SqlQueryPlan/test_dimensions_requiring_join__plan0.xml @@ -254,7 +254,7 @@ - + @@ -265,237 +265,237 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -512,118 +512,118 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 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 f10ffcaeb6..da17778ce3 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 @@ - + - + @@ -29,33 +29,33 @@ - + - + - + - + - + - + - + - + @@ -63,412 +63,412 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -843,33 +843,33 @@ - + - + - + - + - + - + - + - + @@ -877,364 +877,364 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql index 7a6a9e1f3d..48e2471976 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql @@ -69,62 +69,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 WHERE listing__country_latest = 'us' ) subq_1 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0_optimized.sql index ec0d94dac2..53c7bf823f 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT country AS listing__country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_3 WHERE listing__country_latest = 'us' GROUP BY diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql index e95c1119b3..0a436966b2 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -316,62 +316,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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_query_rendering.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql index 29bb79a181..222745cd76 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/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 Semantic Model 'bookings_source' @@ -26,9 +26,9 @@ FROM ( FROM ***************************.fct_bookings 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_query_rendering.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql index d6f3055b49..e0d6b9598a 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql @@ -142,87 +142,87 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10015.booking_value - , bookings_source_src_10015.guest_id AS bookers - , bookings_source_src_10015.booking_value AS average_booking_value - , bookings_source_src_10015.booking_value AS booking_payments - , bookings_source_src_10015.is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy - , bookings_source_src_10015.is_instant AS booking__is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS booking__ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS booking__paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy - , bookings_source_src_10015.listing_id AS listing - , bookings_source_src_10015.guest_id AS guest - , bookings_source_src_10015.host_id AS host - , bookings_source_src_10015.guest_id AS user - , bookings_source_src_10015.listing_id AS booking__listing - , bookings_source_src_10015.guest_id AS booking__guest - , bookings_source_src_10015.host_id AS booking__host - , bookings_source_src_10015.guest_id AS booking__user - FROM ***************************.fct_bookings bookings_source_src_10015 + , bookings_source_src_10017.booking_value + , bookings_source_src_10017.guest_id AS bookers + , bookings_source_src_10017.booking_value AS average_booking_value + , bookings_source_src_10017.booking_value AS booking_payments + , bookings_source_src_10017.is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS paid_at__extract_doy + , bookings_source_src_10017.is_instant AS booking__is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS booking__ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS booking__ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS booking__ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10017.listing_id AS listing + , bookings_source_src_10017.guest_id AS guest + , bookings_source_src_10017.host_id AS host + , bookings_source_src_10017.guest_id AS user + , bookings_source_src_10017.listing_id AS booking__listing + , bookings_source_src_10017.guest_id AS booking__guest + , bookings_source_src_10017.host_id AS booking__host + , bookings_source_src_10017.guest_id AS booking__user + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_0 ) subq_1 ) subq_2 @@ -237,60 +237,60 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'listings' SELECT - listings_src_10017.active_from AS window_start__day - , DATE_TRUNC('week', listings_src_10017.active_from) AS window_start__week - , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month - , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter - , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_from) AS window_start__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy - , listings_src_10017.active_to AS window_end__day - , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week - , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month - , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter - , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_to) AS window_end__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy - , listings_src_10017.country - , listings_src_10017.is_lux - , listings_src_10017.capacity - , listings_src_10017.active_from AS listing__window_start__day - , DATE_TRUNC('week', listings_src_10017.active_from) AS listing__window_start__week - , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month - , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter - , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy - , listings_src_10017.active_to AS listing__window_end__day - , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week - , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month - , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter - , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy - , listings_src_10017.country AS listing__country - , listings_src_10017.is_lux AS listing__is_lux - , listings_src_10017.capacity AS listing__capacity - , listings_src_10017.listing_id AS listing - , listings_src_10017.user_id AS user - , listings_src_10017.user_id AS listing__user - FROM ***************************.dim_listings listings_src_10017 + listings_src_10019.active_from AS window_start__day + , DATE_TRUNC('week', listings_src_10019.active_from) AS window_start__week + , DATE_TRUNC('month', listings_src_10019.active_from) AS window_start__month + , DATE_TRUNC('quarter', listings_src_10019.active_from) AS window_start__quarter + , DATE_TRUNC('year', listings_src_10019.active_from) AS window_start__year + , EXTRACT(year FROM listings_src_10019.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_from) AS window_start__extract_month + , EXTRACT(day FROM listings_src_10019.active_from) AS window_start__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_from) AS window_start__extract_doy + , listings_src_10019.active_to AS window_end__day + , DATE_TRUNC('week', listings_src_10019.active_to) AS window_end__week + , DATE_TRUNC('month', listings_src_10019.active_to) AS window_end__month + , DATE_TRUNC('quarter', listings_src_10019.active_to) AS window_end__quarter + , DATE_TRUNC('year', listings_src_10019.active_to) AS window_end__year + , EXTRACT(year FROM listings_src_10019.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_to) AS window_end__extract_month + , EXTRACT(day FROM listings_src_10019.active_to) AS window_end__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_to) AS window_end__extract_doy + , listings_src_10019.country + , listings_src_10019.is_lux + , listings_src_10019.capacity + , listings_src_10019.active_from AS listing__window_start__day + , DATE_TRUNC('week', listings_src_10019.active_from) AS listing__window_start__week + , DATE_TRUNC('month', listings_src_10019.active_from) AS listing__window_start__month + , DATE_TRUNC('quarter', listings_src_10019.active_from) AS listing__window_start__quarter + , DATE_TRUNC('year', listings_src_10019.active_from) AS listing__window_start__year + , EXTRACT(year FROM listings_src_10019.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_from) AS listing__window_start__extract_month + , EXTRACT(day FROM listings_src_10019.active_from) AS listing__window_start__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_from) AS listing__window_start__extract_doy + , listings_src_10019.active_to AS listing__window_end__day + , DATE_TRUNC('week', listings_src_10019.active_to) AS listing__window_end__week + , DATE_TRUNC('month', listings_src_10019.active_to) AS listing__window_end__month + , DATE_TRUNC('quarter', listings_src_10019.active_to) AS listing__window_end__quarter + , DATE_TRUNC('year', listings_src_10019.active_to) AS listing__window_end__year + , EXTRACT(year FROM listings_src_10019.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_to) AS listing__window_end__extract_month + , EXTRACT(day FROM listings_src_10019.active_to) AS listing__window_end__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_to) AS listing__window_end__extract_doy + , listings_src_10019.country AS listing__country + , listings_src_10019.is_lux AS listing__is_lux + , listings_src_10019.capacity AS listing__capacity + , listings_src_10019.listing_id AS listing + , listings_src_10019.user_id AS user + , listings_src_10019.user_id AS listing__user + FROM ***************************.dim_listings listings_src_10019 ) subq_3 ) subq_4 ON diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql index db1199fc2e..662445e5ef 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql @@ -12,7 +12,7 @@ FROM ( -- ['bookings', 'listing__capacity', 'metric_time__day'] SELECT subq_12.metric_time__day AS metric_time__day - , listings_src_10017.capacity AS listing__capacity + , listings_src_10019.capacity AS listing__capacity , subq_12.bookings AS bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -23,21 +23,21 @@ FROM ( DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10015 + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_12 LEFT OUTER JOIN - ***************************.dim_listings listings_src_10017 + ***************************.dim_listings listings_src_10019 ON ( - subq_12.listing = listings_src_10017.listing_id + subq_12.listing = listings_src_10019.listing_id ) AND ( ( - subq_12.metric_time__day >= listings_src_10017.active_from + subq_12.metric_time__day >= listings_src_10019.active_from ) AND ( ( - subq_12.metric_time__day < listings_src_10017.active_to + subq_12.metric_time__day < listings_src_10019.active_to ) OR ( - listings_src_10017.active_to IS NULL + listings_src_10019.active_to IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql index d3d98e92e5..71d2f78bb5 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql @@ -87,62 +87,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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_query_rendering.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0_optimized.sql index f7932552c3..2c5690447e 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__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_query_rendering.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql index b314ea28d3..8a3cdca410 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql @@ -328,62 +328,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 @@ -717,62 +717,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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_15 ) subq_16 ) subq_17 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0_optimized.sql index 3c0c641be9..5581a37a67 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0_optimized.sql @@ -24,13 +24,13 @@ FROM ( -- ['average_booking_value', 'listing__is_lux_latest', 'metric_time__day'] SELECT DATE_TRUNC('day', bookings_source_src_10001.ds) AS metric_time__day - , listings_latest_src_10004.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest , bookings_source_src_10001.booking_value AS average_booking_value 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 ) subq_37 WHERE listing__is_lux_latest GROUP BY @@ -51,7 +51,7 @@ FROM ( -- ['bookings', 'listing__is_lux_latest', 'metric_time__day'] SELECT subq_44.metric_time__day AS metric_time__day - , listings_latest_src_10004.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest , subq_44.bookings AS bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -65,9 +65,9 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_10001 ) subq_44 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_44.listing = listings_latest_src_10004.listing_id + subq_44.listing = listings_latest_src_10005.listing_id ) subq_49 WHERE listing__is_lux_latest GROUP BY diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 1bbbe9b000..1aa0e36f15 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -304,62 +304,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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_5 ) subq_6 ) subq_7 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql index bd5b5c24ee..1e16df6c0d 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql @@ -22,5 +22,5 @@ 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 ) subq_20 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql index dcc369e93e..df68607098 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql @@ -132,87 +132,87 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10015.booking_value - , bookings_source_src_10015.guest_id AS bookers - , bookings_source_src_10015.booking_value AS average_booking_value - , bookings_source_src_10015.booking_value AS booking_payments - , bookings_source_src_10015.is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy - , bookings_source_src_10015.is_instant AS booking__is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS booking__ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS booking__paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy - , bookings_source_src_10015.listing_id AS listing - , bookings_source_src_10015.guest_id AS guest - , bookings_source_src_10015.host_id AS host - , bookings_source_src_10015.guest_id AS user - , bookings_source_src_10015.listing_id AS booking__listing - , bookings_source_src_10015.guest_id AS booking__guest - , bookings_source_src_10015.host_id AS booking__host - , bookings_source_src_10015.guest_id AS booking__user - FROM ***************************.fct_bookings bookings_source_src_10015 + , bookings_source_src_10017.booking_value + , bookings_source_src_10017.guest_id AS bookers + , bookings_source_src_10017.booking_value AS average_booking_value + , bookings_source_src_10017.booking_value AS booking_payments + , bookings_source_src_10017.is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS paid_at__extract_doy + , bookings_source_src_10017.is_instant AS booking__is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS booking__ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS booking__ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS booking__ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10017.listing_id AS listing + , bookings_source_src_10017.guest_id AS guest + , bookings_source_src_10017.host_id AS host + , bookings_source_src_10017.guest_id AS user + , bookings_source_src_10017.listing_id AS booking__listing + , bookings_source_src_10017.guest_id AS booking__guest + , bookings_source_src_10017.host_id AS booking__host + , bookings_source_src_10017.guest_id AS booking__user + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_0 ) subq_1 ) subq_2 @@ -295,60 +295,60 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'listings' SELECT - listings_src_10017.active_from AS window_start__day - , DATE_TRUNC('week', listings_src_10017.active_from) AS window_start__week - , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month - , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter - , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_from) AS window_start__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy - , listings_src_10017.active_to AS window_end__day - , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week - , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month - , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter - , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_to) AS window_end__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy - , listings_src_10017.country - , listings_src_10017.is_lux - , listings_src_10017.capacity - , listings_src_10017.active_from AS listing__window_start__day - , DATE_TRUNC('week', listings_src_10017.active_from) AS listing__window_start__week - , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month - , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter - , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy - , listings_src_10017.active_to AS listing__window_end__day - , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week - , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month - , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter - , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy - , listings_src_10017.country AS listing__country - , listings_src_10017.is_lux AS listing__is_lux - , listings_src_10017.capacity AS listing__capacity - , listings_src_10017.listing_id AS listing - , listings_src_10017.user_id AS user - , listings_src_10017.user_id AS listing__user - FROM ***************************.dim_listings listings_src_10017 + listings_src_10019.active_from AS window_start__day + , DATE_TRUNC('week', listings_src_10019.active_from) AS window_start__week + , DATE_TRUNC('month', listings_src_10019.active_from) AS window_start__month + , DATE_TRUNC('quarter', listings_src_10019.active_from) AS window_start__quarter + , DATE_TRUNC('year', listings_src_10019.active_from) AS window_start__year + , EXTRACT(year FROM listings_src_10019.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_from) AS window_start__extract_month + , EXTRACT(day FROM listings_src_10019.active_from) AS window_start__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_from) AS window_start__extract_doy + , listings_src_10019.active_to AS window_end__day + , DATE_TRUNC('week', listings_src_10019.active_to) AS window_end__week + , DATE_TRUNC('month', listings_src_10019.active_to) AS window_end__month + , DATE_TRUNC('quarter', listings_src_10019.active_to) AS window_end__quarter + , DATE_TRUNC('year', listings_src_10019.active_to) AS window_end__year + , EXTRACT(year FROM listings_src_10019.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_to) AS window_end__extract_month + , EXTRACT(day FROM listings_src_10019.active_to) AS window_end__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_to) AS window_end__extract_doy + , listings_src_10019.country + , listings_src_10019.is_lux + , listings_src_10019.capacity + , listings_src_10019.active_from AS listing__window_start__day + , DATE_TRUNC('week', listings_src_10019.active_from) AS listing__window_start__week + , DATE_TRUNC('month', listings_src_10019.active_from) AS listing__window_start__month + , DATE_TRUNC('quarter', listings_src_10019.active_from) AS listing__window_start__quarter + , DATE_TRUNC('year', listings_src_10019.active_from) AS listing__window_start__year + , EXTRACT(year FROM listings_src_10019.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_from) AS listing__window_start__extract_month + , EXTRACT(day FROM listings_src_10019.active_from) AS listing__window_start__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_from) AS listing__window_start__extract_doy + , listings_src_10019.active_to AS listing__window_end__day + , DATE_TRUNC('week', listings_src_10019.active_to) AS listing__window_end__week + , DATE_TRUNC('month', listings_src_10019.active_to) AS listing__window_end__month + , DATE_TRUNC('quarter', listings_src_10019.active_to) AS listing__window_end__quarter + , DATE_TRUNC('year', listings_src_10019.active_to) AS listing__window_end__year + , EXTRACT(year FROM listings_src_10019.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_to) AS listing__window_end__extract_month + , EXTRACT(day FROM listings_src_10019.active_to) AS listing__window_end__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_to) AS listing__window_end__extract_doy + , listings_src_10019.country AS listing__country + , listings_src_10019.is_lux AS listing__is_lux + , listings_src_10019.capacity AS listing__capacity + , listings_src_10019.listing_id AS listing + , listings_src_10019.user_id AS user + , listings_src_10019.user_id AS listing__user + FROM ***************************.dim_listings listings_src_10019 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -406,32 +406,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10021.ds) AS ds__day - , DATE_TRUNC('week', users_latest_src_10021.ds) AS ds__week - , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month - , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter - , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year - , EXTRACT(year FROM users_latest_src_10021.ds) AS ds__extract_year - , EXTRACT(quarter FROM users_latest_src_10021.ds) AS ds__extract_quarter - , EXTRACT(month FROM users_latest_src_10021.ds) AS ds__extract_month - , EXTRACT(day FROM users_latest_src_10021.ds) AS ds__extract_day - , EXTRACT(isodow FROM users_latest_src_10021.ds) AS ds__extract_dow - , EXTRACT(doy FROM users_latest_src_10021.ds) AS ds__extract_doy - , users_latest_src_10021.home_state_latest - , DATE_TRUNC('day', users_latest_src_10021.ds) AS user__ds__day - , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week - , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month - , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter - , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year - , EXTRACT(year FROM users_latest_src_10021.ds) AS user__ds__extract_year - , EXTRACT(quarter FROM users_latest_src_10021.ds) AS user__ds__extract_quarter - , EXTRACT(month FROM users_latest_src_10021.ds) AS user__ds__extract_month - , EXTRACT(day FROM users_latest_src_10021.ds) AS user__ds__extract_day - , EXTRACT(isodow FROM users_latest_src_10021.ds) AS user__ds__extract_dow - , EXTRACT(doy FROM users_latest_src_10021.ds) AS user__ds__extract_doy - , users_latest_src_10021.home_state_latest AS user__home_state_latest - , users_latest_src_10021.user_id AS user - FROM ***************************.dim_users_latest users_latest_src_10021 + DATE_TRUNC('day', users_latest_src_10023.ds) AS ds__day + , DATE_TRUNC('week', users_latest_src_10023.ds) AS ds__week + , DATE_TRUNC('month', users_latest_src_10023.ds) AS ds__month + , DATE_TRUNC('quarter', users_latest_src_10023.ds) AS ds__quarter + , DATE_TRUNC('year', users_latest_src_10023.ds) AS ds__year + , EXTRACT(year FROM users_latest_src_10023.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10023.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10023.ds) AS ds__extract_month + , EXTRACT(day FROM users_latest_src_10023.ds) AS ds__extract_day + , EXTRACT(isodow FROM users_latest_src_10023.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10023.ds) AS ds__extract_doy + , users_latest_src_10023.home_state_latest + , DATE_TRUNC('day', users_latest_src_10023.ds) AS user__ds__day + , DATE_TRUNC('week', users_latest_src_10023.ds) AS user__ds__week + , DATE_TRUNC('month', users_latest_src_10023.ds) AS user__ds__month + , DATE_TRUNC('quarter', users_latest_src_10023.ds) AS user__ds__quarter + , DATE_TRUNC('year', users_latest_src_10023.ds) AS user__ds__year + , EXTRACT(year FROM users_latest_src_10023.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10023.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10023.ds) AS user__ds__extract_month + , EXTRACT(day FROM users_latest_src_10023.ds) AS user__ds__extract_day + , EXTRACT(isodow FROM users_latest_src_10023.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10023.ds) AS user__ds__extract_doy + , users_latest_src_10023.home_state_latest AS user__home_state_latest + , users_latest_src_10023.user_id AS user + FROM ***************************.dim_users_latest users_latest_src_10023 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql index aa2ad14d34..afba0439d0 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -16,22 +16,22 @@ FROM ( DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10015 + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_13 LEFT OUTER JOIN ( -- Join Standard Outputs -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - listings_src_10017.active_from AS window_start__day - , listings_src_10017.active_to AS window_end__day - , listings_src_10017.listing_id AS listing - , users_latest_src_10021.home_state_latest AS user__home_state_latest - FROM ***************************.dim_listings listings_src_10017 + listings_src_10019.active_from AS window_start__day + , listings_src_10019.active_to AS window_end__day + , listings_src_10019.listing_id AS listing + , users_latest_src_10023.home_state_latest AS user__home_state_latest + FROM ***************************.dim_listings listings_src_10019 LEFT OUTER JOIN - ***************************.dim_users_latest users_latest_src_10021 + ***************************.dim_users_latest users_latest_src_10023 ON - listings_src_10017.user_id = users_latest_src_10021.user_id + listings_src_10019.user_id = users_latest_src_10023.user_id ) subq_18 ON ( diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql index 34675e44cc..663505fb02 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql @@ -132,87 +132,87 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10015.booking_value - , bookings_source_src_10015.guest_id AS bookers - , bookings_source_src_10015.booking_value AS average_booking_value - , bookings_source_src_10015.booking_value AS booking_payments - , bookings_source_src_10015.is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy - , bookings_source_src_10015.is_instant AS booking__is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS booking__ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS booking__paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy - , bookings_source_src_10015.listing_id AS listing - , bookings_source_src_10015.guest_id AS guest - , bookings_source_src_10015.host_id AS host - , bookings_source_src_10015.guest_id AS user - , bookings_source_src_10015.listing_id AS booking__listing - , bookings_source_src_10015.guest_id AS booking__guest - , bookings_source_src_10015.host_id AS booking__host - , bookings_source_src_10015.guest_id AS booking__user - FROM ***************************.fct_bookings bookings_source_src_10015 + , bookings_source_src_10017.booking_value + , bookings_source_src_10017.guest_id AS bookers + , bookings_source_src_10017.booking_value AS average_booking_value + , bookings_source_src_10017.booking_value AS booking_payments + , bookings_source_src_10017.is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS paid_at__extract_doy + , bookings_source_src_10017.is_instant AS booking__is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS booking__ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS booking__ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS booking__ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10017.listing_id AS listing + , bookings_source_src_10017.guest_id AS guest + , bookings_source_src_10017.host_id AS host + , bookings_source_src_10017.guest_id AS user + , bookings_source_src_10017.listing_id AS booking__listing + , bookings_source_src_10017.guest_id AS booking__guest + , bookings_source_src_10017.host_id AS booking__host + , bookings_source_src_10017.guest_id AS booking__user + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_0 ) subq_1 ) subq_2 @@ -259,10 +259,10 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'lux_listing_mapping' SELECT - lux_listing_mapping_src_10018.listing_id AS listing - , lux_listing_mapping_src_10018.lux_listing_id AS lux_listing - , lux_listing_mapping_src_10018.lux_listing_id AS listing__lux_listing - FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 + lux_listing_mapping_src_10020.listing_id AS listing + , lux_listing_mapping_src_10020.lux_listing_id AS lux_listing + , lux_listing_mapping_src_10020.lux_listing_id AS listing__lux_listing + FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10020 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -364,54 +364,54 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'lux_listings' SELECT - lux_listings_src_10019.valid_from AS window_start__day - , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS window_start__week - , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month - , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter - , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year - , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS window_start__extract_year - , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter - , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS window_start__extract_month - , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS window_start__extract_day - , EXTRACT(isodow FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow - , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy - , lux_listings_src_10019.valid_to AS window_end__day - , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week - , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month - , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter - , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year - , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS window_end__extract_year - , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter - , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS window_end__extract_month - , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS window_end__extract_day - , EXTRACT(isodow FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow - , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy - , lux_listings_src_10019.is_confirmed_lux - , lux_listings_src_10019.valid_from AS lux_listing__window_start__day - , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week - , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month - , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter - , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year - , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year - , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter - , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month - , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day - , EXTRACT(isodow FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow - , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy - , lux_listings_src_10019.valid_to AS lux_listing__window_end__day - , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week - , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month - , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter - , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year - , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year - , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter - , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month - , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day - , EXTRACT(isodow FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow - , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy - , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux - , lux_listings_src_10019.lux_listing_id AS lux_listing - FROM ***************************.dim_lux_listings lux_listings_src_10019 + lux_listings_src_10021.valid_from AS window_start__day + , DATE_TRUNC('week', lux_listings_src_10021.valid_from) AS window_start__week + , DATE_TRUNC('month', lux_listings_src_10021.valid_from) AS window_start__month + , DATE_TRUNC('quarter', lux_listings_src_10021.valid_from) AS window_start__quarter + , DATE_TRUNC('year', lux_listings_src_10021.valid_from) AS window_start__year + , EXTRACT(year FROM lux_listings_src_10021.valid_from) AS window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10021.valid_from) AS window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10021.valid_from) AS window_start__extract_month + , EXTRACT(day FROM lux_listings_src_10021.valid_from) AS window_start__extract_day + , EXTRACT(isodow FROM lux_listings_src_10021.valid_from) AS window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10021.valid_from) AS window_start__extract_doy + , lux_listings_src_10021.valid_to AS window_end__day + , DATE_TRUNC('week', lux_listings_src_10021.valid_to) AS window_end__week + , DATE_TRUNC('month', lux_listings_src_10021.valid_to) AS window_end__month + , DATE_TRUNC('quarter', lux_listings_src_10021.valid_to) AS window_end__quarter + , DATE_TRUNC('year', lux_listings_src_10021.valid_to) AS window_end__year + , EXTRACT(year FROM lux_listings_src_10021.valid_to) AS window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10021.valid_to) AS window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10021.valid_to) AS window_end__extract_month + , EXTRACT(day FROM lux_listings_src_10021.valid_to) AS window_end__extract_day + , EXTRACT(isodow FROM lux_listings_src_10021.valid_to) AS window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10021.valid_to) AS window_end__extract_doy + , lux_listings_src_10021.is_confirmed_lux + , lux_listings_src_10021.valid_from AS lux_listing__window_start__day + , DATE_TRUNC('week', lux_listings_src_10021.valid_from) AS lux_listing__window_start__week + , DATE_TRUNC('month', lux_listings_src_10021.valid_from) AS lux_listing__window_start__month + , DATE_TRUNC('quarter', lux_listings_src_10021.valid_from) AS lux_listing__window_start__quarter + , DATE_TRUNC('year', lux_listings_src_10021.valid_from) AS lux_listing__window_start__year + , EXTRACT(year FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(day FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(isodow FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_doy + , lux_listings_src_10021.valid_to AS lux_listing__window_end__day + , DATE_TRUNC('week', lux_listings_src_10021.valid_to) AS lux_listing__window_end__week + , DATE_TRUNC('month', lux_listings_src_10021.valid_to) AS lux_listing__window_end__month + , DATE_TRUNC('quarter', lux_listings_src_10021.valid_to) AS lux_listing__window_end__quarter + , DATE_TRUNC('year', lux_listings_src_10021.valid_to) AS lux_listing__window_end__year + , EXTRACT(year FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(day FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(isodow FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_doy + , lux_listings_src_10021.is_confirmed_lux AS lux_listing__is_confirmed_lux + , lux_listings_src_10021.lux_listing_id AS lux_listing + FROM ***************************.dim_lux_listings lux_listings_src_10021 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql index add7e259ab..16470814e6 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -16,7 +16,7 @@ FROM ( DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10015 + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_13 LEFT OUTER JOIN ( -- Join Standard Outputs @@ -26,15 +26,15 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - lux_listings_src_10019.valid_from AS lux_listing__window_start__day - , lux_listings_src_10019.valid_to AS lux_listing__window_end__day - , lux_listing_mapping_src_10018.listing_id AS listing - , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux - FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 + lux_listings_src_10021.valid_from AS lux_listing__window_start__day + , lux_listings_src_10021.valid_to AS lux_listing__window_end__day + , lux_listing_mapping_src_10020.listing_id AS listing + , lux_listings_src_10021.is_confirmed_lux AS lux_listing__is_confirmed_lux + FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10020 LEFT OUTER JOIN - ***************************.dim_lux_listings lux_listings_src_10019 + ***************************.dim_lux_listings lux_listings_src_10021 ON - lux_listing_mapping_src_10018.lux_listing_id = lux_listings_src_10019.lux_listing_id + lux_listing_mapping_src_10020.lux_listing_id = lux_listings_src_10021.lux_listing_id ) subq_18 ON ( diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql index 66555fd231..317c69a37f 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql @@ -93,55 +93,55 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'account_month_txns' SELECT - account_month_txns_src_10010.txn_count - , DATE_TRUNC('day', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy - , DATE_TRUNC('day', account_month_txns_src_10010.ds) AS ds__day - , 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 - , EXTRACT(year FROM account_month_txns_src_10010.ds) AS ds__extract_year - , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS ds__extract_quarter - , EXTRACT(month FROM account_month_txns_src_10010.ds) AS ds__extract_month - , EXTRACT(day FROM account_month_txns_src_10010.ds) AS ds__extract_day - , EXTRACT(isodow FROM account_month_txns_src_10010.ds) AS ds__extract_dow - , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS ds__extract_doy - , account_month_txns_src_10010.account_month - , DATE_TRUNC('day', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__day - , 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 - , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(isodow FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow - , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy - , DATE_TRUNC('day', account_month_txns_src_10010.ds) AS account_id__ds__day - , 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 - , EXTRACT(year FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year - , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter - , EXTRACT(month FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month - , EXTRACT(day FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day - , EXTRACT(isodow FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow - , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy - , 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 + , DATE_TRUNC('day', account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_doy + , DATE_TRUNC('day', account_month_txns_src_10012.ds) AS ds__day + , 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 + , EXTRACT(year FROM account_month_txns_src_10012.ds) AS ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10012.ds) AS ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10012.ds) AS ds__extract_month + , EXTRACT(day FROM account_month_txns_src_10012.ds) AS ds__extract_day + , EXTRACT(isodow FROM account_month_txns_src_10012.ds) AS ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10012.ds) AS ds__extract_doy + , account_month_txns_src_10012.account_month + , DATE_TRUNC('day', account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__day + , 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 + , EXTRACT(year FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(day FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(isodow FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_doy + , DATE_TRUNC('day', account_month_txns_src_10012.ds) AS account_id__ds__day + , 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 + , EXTRACT(year FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_month + , EXTRACT(day FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_day + , EXTRACT(isodow FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_doy + , 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 @@ -212,48 +212,48 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'bridge_table' SELECT - bridge_table_src_10011.extra_dim - , DATE_TRUNC('day', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy - , bridge_table_src_10011.extra_dim AS account_id__extra_dim - , DATE_TRUNC('day', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__day - , 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 - , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(isodow FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow - , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy - , bridge_table_src_10011.extra_dim AS bridge_account__extra_dim - , DATE_TRUNC('day', bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__day - , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__week - , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__month - , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__quarter - , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__year - , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_year - , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_quarter - , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_month - , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_day - , EXTRACT(isodow FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_dow - , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_doy - , bridge_table_src_10011.account_id - , bridge_table_src_10011.customer_id - , bridge_table_src_10011.customer_id AS account_id__customer_id - , bridge_table_src_10011.account_id AS bridge_account__account_id - , bridge_table_src_10011.customer_id AS bridge_account__customer_id - FROM ***************************.bridge_table bridge_table_src_10011 + bridge_table_src_10013.extra_dim + , DATE_TRUNC('day', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy + , bridge_table_src_10013.extra_dim AS account_id__extra_dim + , DATE_TRUNC('day', bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__day + , 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 + , EXTRACT(year FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(day FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(isodow FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_doy + , bridge_table_src_10013.extra_dim AS bridge_account__extra_dim + , DATE_TRUNC('day', bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__day + , DATE_TRUNC('week', bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__week + , DATE_TRUNC('month', bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__month + , DATE_TRUNC('quarter', bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__quarter + , DATE_TRUNC('year', bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__year + , EXTRACT(year FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_month + , EXTRACT(day FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_day + , EXTRACT(isodow FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_doy + , bridge_table_src_10013.account_id + , bridge_table_src_10013.customer_id + , bridge_table_src_10013.customer_id AS account_id__customer_id + , bridge_table_src_10013.account_id AS bridge_account__account_id + , bridge_table_src_10013.customer_id AS bridge_account__customer_id + FROM ***************************.bridge_table bridge_table_src_10013 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -315,34 +315,34 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'customer_table' SELECT - customer_table_src_10013.customer_name - , customer_table_src_10013.customer_atomic_weight - , DATE_TRUNC('day', customer_table_src_10013.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy - , customer_table_src_10013.customer_name AS customer_id__customer_name - , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight - , DATE_TRUNC('day', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__day - , 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 - , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year - , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter - , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month - , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day - , EXTRACT(isodow FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow - , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy - , 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 + , DATE_TRUNC('day', customer_table_src_10015.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_doy + , customer_table_src_10015.customer_name AS customer_id__customer_name + , customer_table_src_10015.customer_atomic_weight AS customer_id__customer_atomic_weight + , DATE_TRUNC('day', customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__day + , 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 + , EXTRACT(year FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(day FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(isodow FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_doy + , 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_query_rendering.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0_optimized.sql index 8a42052413..65d688b745 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/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__day', 'account_id'] SELECT - DATE_TRUNC('day', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__day - , 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 + DATE_TRUNC('day', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__day + , 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 ( - DATE_TRUNC('day', bridge_table_src_10011.ds_partitioned) = DATE_TRUNC('day', customer_table_src_10013.ds_partitioned) + DATE_TRUNC('day', bridge_table_src_10013.ds_partitioned) = DATE_TRUNC('day', 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 ( - DATE_TRUNC('day', account_month_txns_src_10010.ds_partitioned) = subq_18.ds_partitioned__day + DATE_TRUNC('day', account_month_txns_src_10012.ds_partitioned) = subq_18.ds_partitioned__day ) GROUP BY subq_18.customer_id__customer_name diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql index 7ad1c04247..6552f995c8 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql @@ -473,62 +473,62 @@ CROSS JOIN ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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__day BETWEEN '2020-01-01' AND '2020-01-01' diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0_optimized.sql index 631546edf7..5fdefdb6a7 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0_optimized.sql @@ -25,6 +25,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 DATE_TRUNC('day', created_at) BETWEEN '2020-01-01' AND '2020-01-01' ) subq_23 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql index 1673729a9a..166092a420 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql @@ -96,56 +96,56 @@ FROM ( -- Read Elements From Semantic Model 'id_verifications' SELECT 1 AS identity_verifications - , DATE_TRUNC('day', id_verifications_src_10003.ds) AS ds__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds) AS ds__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy - , DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy - , id_verifications_src_10003.verification_type - , DATE_TRUNC('day', id_verifications_src_10003.ds) AS verification__ds__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy - , DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy - , 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 + , DATE_TRUNC('day', id_verifications_src_10004.ds) AS ds__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds) AS ds__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds) AS ds__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds) AS ds__extract_doy + , DATE_TRUNC('day', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_doy + , id_verifications_src_10004.verification_type + , DATE_TRUNC('day', id_verifications_src_10004.ds) AS verification__ds__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds) AS verification__ds__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds) AS verification__ds__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds) AS verification__ds__extract_doy + , DATE_TRUNC('day', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_doy + , 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 @@ -159,76 +159,76 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_ds_source' SELECT - DATE_TRUNC('day', users_ds_source_src_10007.ds) AS ds__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.ds) AS ds__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS ds__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.ds) AS ds__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.ds) AS ds__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.ds) AS ds__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS ds__extract_doy - , DATE_TRUNC('day', users_ds_source_src_10007.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS created_at__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy - , DATE_TRUNC('day', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy - , users_ds_source_src_10007.home_state - , DATE_TRUNC('day', users_ds_source_src_10007.ds) AS user__ds__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.ds) AS user__ds__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.ds) AS user__ds__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.ds) AS user__ds__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy - , DATE_TRUNC('day', users_ds_source_src_10007.created_at) AS user__created_at__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy - , DATE_TRUNC('day', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy - , 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 + DATE_TRUNC('day', users_ds_source_src_10008.ds) AS ds__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.ds) AS ds__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.ds) AS ds__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.ds) AS ds__extract_doy + , DATE_TRUNC('day', users_ds_source_src_10008.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.created_at) AS created_at__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.created_at) AS created_at__extract_doy + , DATE_TRUNC('day', users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_doy + , users_ds_source_src_10008.home_state + , DATE_TRUNC('day', users_ds_source_src_10008.ds) AS user__ds__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.ds) AS user__ds__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.ds) AS user__ds__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.ds) AS user__ds__extract_doy + , DATE_TRUNC('day', users_ds_source_src_10008.created_at) AS user__created_at__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_doy + , DATE_TRUNC('day', users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_doy + , 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_query_rendering.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0_optimized.sql index c15982d861..b52d743037 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/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 Semantic Model 'id_verifications' @@ -15,15 +15,15 @@ FROM ( DATE_TRUNC('day', ds_partitioned) AS ds_partitioned__day , 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__day = DATE_TRUNC('day', users_ds_source_src_10007.ds_partitioned) + subq_10.ds_partitioned__day = DATE_TRUNC('day', 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_query_rendering.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql index 7a6a9e1f3d..48e2471976 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql @@ -69,62 +69,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 WHERE listing__country_latest = 'us' ) subq_1 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_distinct_values__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_distinct_values__plan0_optimized.sql index ec0d94dac2..53c7bf823f 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_distinct_values__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_distinct_values__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT country AS listing__country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_3 WHERE listing__country_latest = 'us' GROUP BY diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql index e95c1119b3..0a436966b2 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -316,62 +316,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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_query_rendering.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql index 29bb79a181..222745cd76 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/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 Semantic Model 'bookings_source' @@ -26,9 +26,9 @@ FROM ( FROM ***************************.fct_bookings 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_query_rendering.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql index d6f3055b49..e0d6b9598a 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql @@ -142,87 +142,87 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10015.booking_value - , bookings_source_src_10015.guest_id AS bookers - , bookings_source_src_10015.booking_value AS average_booking_value - , bookings_source_src_10015.booking_value AS booking_payments - , bookings_source_src_10015.is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy - , bookings_source_src_10015.is_instant AS booking__is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS booking__ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS booking__paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy - , bookings_source_src_10015.listing_id AS listing - , bookings_source_src_10015.guest_id AS guest - , bookings_source_src_10015.host_id AS host - , bookings_source_src_10015.guest_id AS user - , bookings_source_src_10015.listing_id AS booking__listing - , bookings_source_src_10015.guest_id AS booking__guest - , bookings_source_src_10015.host_id AS booking__host - , bookings_source_src_10015.guest_id AS booking__user - FROM ***************************.fct_bookings bookings_source_src_10015 + , bookings_source_src_10017.booking_value + , bookings_source_src_10017.guest_id AS bookers + , bookings_source_src_10017.booking_value AS average_booking_value + , bookings_source_src_10017.booking_value AS booking_payments + , bookings_source_src_10017.is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS paid_at__extract_doy + , bookings_source_src_10017.is_instant AS booking__is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS booking__ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS booking__ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS booking__ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10017.listing_id AS listing + , bookings_source_src_10017.guest_id AS guest + , bookings_source_src_10017.host_id AS host + , bookings_source_src_10017.guest_id AS user + , bookings_source_src_10017.listing_id AS booking__listing + , bookings_source_src_10017.guest_id AS booking__guest + , bookings_source_src_10017.host_id AS booking__host + , bookings_source_src_10017.guest_id AS booking__user + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_0 ) subq_1 ) subq_2 @@ -237,60 +237,60 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'listings' SELECT - listings_src_10017.active_from AS window_start__day - , DATE_TRUNC('week', listings_src_10017.active_from) AS window_start__week - , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month - , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter - , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_from) AS window_start__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy - , listings_src_10017.active_to AS window_end__day - , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week - , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month - , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter - , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_to) AS window_end__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy - , listings_src_10017.country - , listings_src_10017.is_lux - , listings_src_10017.capacity - , listings_src_10017.active_from AS listing__window_start__day - , DATE_TRUNC('week', listings_src_10017.active_from) AS listing__window_start__week - , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month - , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter - , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy - , listings_src_10017.active_to AS listing__window_end__day - , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week - , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month - , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter - , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy - , listings_src_10017.country AS listing__country - , listings_src_10017.is_lux AS listing__is_lux - , listings_src_10017.capacity AS listing__capacity - , listings_src_10017.listing_id AS listing - , listings_src_10017.user_id AS user - , listings_src_10017.user_id AS listing__user - FROM ***************************.dim_listings listings_src_10017 + listings_src_10019.active_from AS window_start__day + , DATE_TRUNC('week', listings_src_10019.active_from) AS window_start__week + , DATE_TRUNC('month', listings_src_10019.active_from) AS window_start__month + , DATE_TRUNC('quarter', listings_src_10019.active_from) AS window_start__quarter + , DATE_TRUNC('year', listings_src_10019.active_from) AS window_start__year + , EXTRACT(year FROM listings_src_10019.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_from) AS window_start__extract_month + , EXTRACT(day FROM listings_src_10019.active_from) AS window_start__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_from) AS window_start__extract_doy + , listings_src_10019.active_to AS window_end__day + , DATE_TRUNC('week', listings_src_10019.active_to) AS window_end__week + , DATE_TRUNC('month', listings_src_10019.active_to) AS window_end__month + , DATE_TRUNC('quarter', listings_src_10019.active_to) AS window_end__quarter + , DATE_TRUNC('year', listings_src_10019.active_to) AS window_end__year + , EXTRACT(year FROM listings_src_10019.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_to) AS window_end__extract_month + , EXTRACT(day FROM listings_src_10019.active_to) AS window_end__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_to) AS window_end__extract_doy + , listings_src_10019.country + , listings_src_10019.is_lux + , listings_src_10019.capacity + , listings_src_10019.active_from AS listing__window_start__day + , DATE_TRUNC('week', listings_src_10019.active_from) AS listing__window_start__week + , DATE_TRUNC('month', listings_src_10019.active_from) AS listing__window_start__month + , DATE_TRUNC('quarter', listings_src_10019.active_from) AS listing__window_start__quarter + , DATE_TRUNC('year', listings_src_10019.active_from) AS listing__window_start__year + , EXTRACT(year FROM listings_src_10019.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_from) AS listing__window_start__extract_month + , EXTRACT(day FROM listings_src_10019.active_from) AS listing__window_start__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_from) AS listing__window_start__extract_doy + , listings_src_10019.active_to AS listing__window_end__day + , DATE_TRUNC('week', listings_src_10019.active_to) AS listing__window_end__week + , DATE_TRUNC('month', listings_src_10019.active_to) AS listing__window_end__month + , DATE_TRUNC('quarter', listings_src_10019.active_to) AS listing__window_end__quarter + , DATE_TRUNC('year', listings_src_10019.active_to) AS listing__window_end__year + , EXTRACT(year FROM listings_src_10019.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_to) AS listing__window_end__extract_month + , EXTRACT(day FROM listings_src_10019.active_to) AS listing__window_end__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_to) AS listing__window_end__extract_doy + , listings_src_10019.country AS listing__country + , listings_src_10019.is_lux AS listing__is_lux + , listings_src_10019.capacity AS listing__capacity + , listings_src_10019.listing_id AS listing + , listings_src_10019.user_id AS user + , listings_src_10019.user_id AS listing__user + FROM ***************************.dim_listings listings_src_10019 ) subq_3 ) subq_4 ON diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql index db1199fc2e..662445e5ef 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql @@ -12,7 +12,7 @@ FROM ( -- ['bookings', 'listing__capacity', 'metric_time__day'] SELECT subq_12.metric_time__day AS metric_time__day - , listings_src_10017.capacity AS listing__capacity + , listings_src_10019.capacity AS listing__capacity , subq_12.bookings AS bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -23,21 +23,21 @@ FROM ( DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10015 + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_12 LEFT OUTER JOIN - ***************************.dim_listings listings_src_10017 + ***************************.dim_listings listings_src_10019 ON ( - subq_12.listing = listings_src_10017.listing_id + subq_12.listing = listings_src_10019.listing_id ) AND ( ( - subq_12.metric_time__day >= listings_src_10017.active_from + subq_12.metric_time__day >= listings_src_10019.active_from ) AND ( ( - subq_12.metric_time__day < listings_src_10017.active_to + subq_12.metric_time__day < listings_src_10019.active_to ) OR ( - listings_src_10017.active_to IS NULL + listings_src_10019.active_to IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql index d3d98e92e5..71d2f78bb5 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql @@ -87,62 +87,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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_query_rendering.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0_optimized.sql index f7932552c3..2c5690447e 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__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_query_rendering.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql index b314ea28d3..8a3cdca410 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql @@ -328,62 +328,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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 @@ -717,62 +717,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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_15 ) subq_16 ) subq_17 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0_optimized.sql index 3c0c641be9..5581a37a67 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0_optimized.sql @@ -24,13 +24,13 @@ FROM ( -- ['average_booking_value', 'listing__is_lux_latest', 'metric_time__day'] SELECT DATE_TRUNC('day', bookings_source_src_10001.ds) AS metric_time__day - , listings_latest_src_10004.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest , bookings_source_src_10001.booking_value AS average_booking_value 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 ) subq_37 WHERE listing__is_lux_latest GROUP BY @@ -51,7 +51,7 @@ FROM ( -- ['bookings', 'listing__is_lux_latest', 'metric_time__day'] SELECT subq_44.metric_time__day AS metric_time__day - , listings_latest_src_10004.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest , subq_44.bookings AS bookings FROM ( -- Read Elements From Semantic Model 'bookings_source' @@ -65,9 +65,9 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_10001 ) subq_44 LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10004 + ***************************.dim_listings_latest listings_latest_src_10005 ON - subq_44.listing = listings_latest_src_10004.listing_id + subq_44.listing = listings_latest_src_10005.listing_id ) subq_49 WHERE listing__is_lux_latest GROUP BY diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 8222b0adff..51a19b2509 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -304,62 +304,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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_5 ) subq_6 ) subq_7 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql index c48f7d8d21..7dc6fd2c91 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0_optimized.sql @@ -22,5 +22,5 @@ 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 ) subq_20 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql index dcc369e93e..df68607098 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql @@ -132,87 +132,87 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10015.booking_value - , bookings_source_src_10015.guest_id AS bookers - , bookings_source_src_10015.booking_value AS average_booking_value - , bookings_source_src_10015.booking_value AS booking_payments - , bookings_source_src_10015.is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy - , bookings_source_src_10015.is_instant AS booking__is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS booking__ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS booking__paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy - , bookings_source_src_10015.listing_id AS listing - , bookings_source_src_10015.guest_id AS guest - , bookings_source_src_10015.host_id AS host - , bookings_source_src_10015.guest_id AS user - , bookings_source_src_10015.listing_id AS booking__listing - , bookings_source_src_10015.guest_id AS booking__guest - , bookings_source_src_10015.host_id AS booking__host - , bookings_source_src_10015.guest_id AS booking__user - FROM ***************************.fct_bookings bookings_source_src_10015 + , bookings_source_src_10017.booking_value + , bookings_source_src_10017.guest_id AS bookers + , bookings_source_src_10017.booking_value AS average_booking_value + , bookings_source_src_10017.booking_value AS booking_payments + , bookings_source_src_10017.is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS paid_at__extract_doy + , bookings_source_src_10017.is_instant AS booking__is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS booking__ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS booking__ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS booking__ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10017.listing_id AS listing + , bookings_source_src_10017.guest_id AS guest + , bookings_source_src_10017.host_id AS host + , bookings_source_src_10017.guest_id AS user + , bookings_source_src_10017.listing_id AS booking__listing + , bookings_source_src_10017.guest_id AS booking__guest + , bookings_source_src_10017.host_id AS booking__host + , bookings_source_src_10017.guest_id AS booking__user + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_0 ) subq_1 ) subq_2 @@ -295,60 +295,60 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'listings' SELECT - listings_src_10017.active_from AS window_start__day - , DATE_TRUNC('week', listings_src_10017.active_from) AS window_start__week - , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month - , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter - , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_from) AS window_start__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy - , listings_src_10017.active_to AS window_end__day - , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week - , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month - , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter - , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_to) AS window_end__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy - , listings_src_10017.country - , listings_src_10017.is_lux - , listings_src_10017.capacity - , listings_src_10017.active_from AS listing__window_start__day - , DATE_TRUNC('week', listings_src_10017.active_from) AS listing__window_start__week - , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month - , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter - , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy - , listings_src_10017.active_to AS listing__window_end__day - , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week - , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month - , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter - , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(isodow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow - , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy - , listings_src_10017.country AS listing__country - , listings_src_10017.is_lux AS listing__is_lux - , listings_src_10017.capacity AS listing__capacity - , listings_src_10017.listing_id AS listing - , listings_src_10017.user_id AS user - , listings_src_10017.user_id AS listing__user - FROM ***************************.dim_listings listings_src_10017 + listings_src_10019.active_from AS window_start__day + , DATE_TRUNC('week', listings_src_10019.active_from) AS window_start__week + , DATE_TRUNC('month', listings_src_10019.active_from) AS window_start__month + , DATE_TRUNC('quarter', listings_src_10019.active_from) AS window_start__quarter + , DATE_TRUNC('year', listings_src_10019.active_from) AS window_start__year + , EXTRACT(year FROM listings_src_10019.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_from) AS window_start__extract_month + , EXTRACT(day FROM listings_src_10019.active_from) AS window_start__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_from) AS window_start__extract_doy + , listings_src_10019.active_to AS window_end__day + , DATE_TRUNC('week', listings_src_10019.active_to) AS window_end__week + , DATE_TRUNC('month', listings_src_10019.active_to) AS window_end__month + , DATE_TRUNC('quarter', listings_src_10019.active_to) AS window_end__quarter + , DATE_TRUNC('year', listings_src_10019.active_to) AS window_end__year + , EXTRACT(year FROM listings_src_10019.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_to) AS window_end__extract_month + , EXTRACT(day FROM listings_src_10019.active_to) AS window_end__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_to) AS window_end__extract_doy + , listings_src_10019.country + , listings_src_10019.is_lux + , listings_src_10019.capacity + , listings_src_10019.active_from AS listing__window_start__day + , DATE_TRUNC('week', listings_src_10019.active_from) AS listing__window_start__week + , DATE_TRUNC('month', listings_src_10019.active_from) AS listing__window_start__month + , DATE_TRUNC('quarter', listings_src_10019.active_from) AS listing__window_start__quarter + , DATE_TRUNC('year', listings_src_10019.active_from) AS listing__window_start__year + , EXTRACT(year FROM listings_src_10019.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_from) AS listing__window_start__extract_month + , EXTRACT(day FROM listings_src_10019.active_from) AS listing__window_start__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_from) AS listing__window_start__extract_doy + , listings_src_10019.active_to AS listing__window_end__day + , DATE_TRUNC('week', listings_src_10019.active_to) AS listing__window_end__week + , DATE_TRUNC('month', listings_src_10019.active_to) AS listing__window_end__month + , DATE_TRUNC('quarter', listings_src_10019.active_to) AS listing__window_end__quarter + , DATE_TRUNC('year', listings_src_10019.active_to) AS listing__window_end__year + , EXTRACT(year FROM listings_src_10019.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10019.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10019.active_to) AS listing__window_end__extract_month + , EXTRACT(day FROM listings_src_10019.active_to) AS listing__window_end__extract_day + , EXTRACT(isodow FROM listings_src_10019.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10019.active_to) AS listing__window_end__extract_doy + , listings_src_10019.country AS listing__country + , listings_src_10019.is_lux AS listing__is_lux + , listings_src_10019.capacity AS listing__capacity + , listings_src_10019.listing_id AS listing + , listings_src_10019.user_id AS user + , listings_src_10019.user_id AS listing__user + FROM ***************************.dim_listings listings_src_10019 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -406,32 +406,32 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_latest' SELECT - DATE_TRUNC('day', users_latest_src_10021.ds) AS ds__day - , DATE_TRUNC('week', users_latest_src_10021.ds) AS ds__week - , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month - , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter - , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year - , EXTRACT(year FROM users_latest_src_10021.ds) AS ds__extract_year - , EXTRACT(quarter FROM users_latest_src_10021.ds) AS ds__extract_quarter - , EXTRACT(month FROM users_latest_src_10021.ds) AS ds__extract_month - , EXTRACT(day FROM users_latest_src_10021.ds) AS ds__extract_day - , EXTRACT(isodow FROM users_latest_src_10021.ds) AS ds__extract_dow - , EXTRACT(doy FROM users_latest_src_10021.ds) AS ds__extract_doy - , users_latest_src_10021.home_state_latest - , DATE_TRUNC('day', users_latest_src_10021.ds) AS user__ds__day - , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week - , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month - , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter - , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year - , EXTRACT(year FROM users_latest_src_10021.ds) AS user__ds__extract_year - , EXTRACT(quarter FROM users_latest_src_10021.ds) AS user__ds__extract_quarter - , EXTRACT(month FROM users_latest_src_10021.ds) AS user__ds__extract_month - , EXTRACT(day FROM users_latest_src_10021.ds) AS user__ds__extract_day - , EXTRACT(isodow FROM users_latest_src_10021.ds) AS user__ds__extract_dow - , EXTRACT(doy FROM users_latest_src_10021.ds) AS user__ds__extract_doy - , users_latest_src_10021.home_state_latest AS user__home_state_latest - , users_latest_src_10021.user_id AS user - FROM ***************************.dim_users_latest users_latest_src_10021 + DATE_TRUNC('day', users_latest_src_10023.ds) AS ds__day + , DATE_TRUNC('week', users_latest_src_10023.ds) AS ds__week + , DATE_TRUNC('month', users_latest_src_10023.ds) AS ds__month + , DATE_TRUNC('quarter', users_latest_src_10023.ds) AS ds__quarter + , DATE_TRUNC('year', users_latest_src_10023.ds) AS ds__year + , EXTRACT(year FROM users_latest_src_10023.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10023.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10023.ds) AS ds__extract_month + , EXTRACT(day FROM users_latest_src_10023.ds) AS ds__extract_day + , EXTRACT(isodow FROM users_latest_src_10023.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10023.ds) AS ds__extract_doy + , users_latest_src_10023.home_state_latest + , DATE_TRUNC('day', users_latest_src_10023.ds) AS user__ds__day + , DATE_TRUNC('week', users_latest_src_10023.ds) AS user__ds__week + , DATE_TRUNC('month', users_latest_src_10023.ds) AS user__ds__month + , DATE_TRUNC('quarter', users_latest_src_10023.ds) AS user__ds__quarter + , DATE_TRUNC('year', users_latest_src_10023.ds) AS user__ds__year + , EXTRACT(year FROM users_latest_src_10023.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10023.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10023.ds) AS user__ds__extract_month + , EXTRACT(day FROM users_latest_src_10023.ds) AS user__ds__extract_day + , EXTRACT(isodow FROM users_latest_src_10023.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10023.ds) AS user__ds__extract_doy + , users_latest_src_10023.home_state_latest AS user__home_state_latest + , users_latest_src_10023.user_id AS user + FROM ***************************.dim_users_latest users_latest_src_10023 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql index aa2ad14d34..afba0439d0 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -16,22 +16,22 @@ FROM ( DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10015 + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_13 LEFT OUTER JOIN ( -- Join Standard Outputs -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - listings_src_10017.active_from AS window_start__day - , listings_src_10017.active_to AS window_end__day - , listings_src_10017.listing_id AS listing - , users_latest_src_10021.home_state_latest AS user__home_state_latest - FROM ***************************.dim_listings listings_src_10017 + listings_src_10019.active_from AS window_start__day + , listings_src_10019.active_to AS window_end__day + , listings_src_10019.listing_id AS listing + , users_latest_src_10023.home_state_latest AS user__home_state_latest + FROM ***************************.dim_listings listings_src_10019 LEFT OUTER JOIN - ***************************.dim_users_latest users_latest_src_10021 + ***************************.dim_users_latest users_latest_src_10023 ON - listings_src_10017.user_id = users_latest_src_10021.user_id + listings_src_10019.user_id = users_latest_src_10023.user_id ) subq_18 ON ( diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql index 34675e44cc..663505fb02 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql @@ -132,87 +132,87 @@ FROM ( SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10015.booking_value - , bookings_source_src_10015.guest_id AS bookers - , bookings_source_src_10015.booking_value AS average_booking_value - , bookings_source_src_10015.booking_value AS booking_payments - , bookings_source_src_10015.is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy - , bookings_source_src_10015.is_instant AS booking__is_instant - , DATE_TRUNC('day', bookings_source_src_10015.ds) AS booking__ds__day - , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week - , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__day - , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy - , DATE_TRUNC('day', bookings_source_src_10015.paid_at) AS booking__paid_at__day - , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week - , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month - , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter - , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(isodow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy - , bookings_source_src_10015.listing_id AS listing - , bookings_source_src_10015.guest_id AS guest - , bookings_source_src_10015.host_id AS host - , bookings_source_src_10015.guest_id AS user - , bookings_source_src_10015.listing_id AS booking__listing - , bookings_source_src_10015.guest_id AS booking__guest - , bookings_source_src_10015.host_id AS booking__host - , bookings_source_src_10015.guest_id AS booking__user - FROM ***************************.fct_bookings bookings_source_src_10015 + , bookings_source_src_10017.booking_value + , bookings_source_src_10017.guest_id AS bookers + , bookings_source_src_10017.booking_value AS average_booking_value + , bookings_source_src_10017.booking_value AS booking_payments + , bookings_source_src_10017.is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS paid_at__extract_doy + , bookings_source_src_10017.is_instant AS booking__is_instant + , DATE_TRUNC('day', bookings_source_src_10017.ds) AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10017.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10017.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10017.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds) AS booking__ds__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds) AS booking__ds__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds) AS booking__ds__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(day FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.ds_partitioned) AS booking__ds_partitioned__extract_doy + , DATE_TRUNC('day', bookings_source_src_10017.paid_at) AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10017.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10017.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10017.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10017.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_month + , EXTRACT(day FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_day + , EXTRACT(isodow FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10017.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10017.listing_id AS listing + , bookings_source_src_10017.guest_id AS guest + , bookings_source_src_10017.host_id AS host + , bookings_source_src_10017.guest_id AS user + , bookings_source_src_10017.listing_id AS booking__listing + , bookings_source_src_10017.guest_id AS booking__guest + , bookings_source_src_10017.host_id AS booking__host + , bookings_source_src_10017.guest_id AS booking__user + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_0 ) subq_1 ) subq_2 @@ -259,10 +259,10 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'lux_listing_mapping' SELECT - lux_listing_mapping_src_10018.listing_id AS listing - , lux_listing_mapping_src_10018.lux_listing_id AS lux_listing - , lux_listing_mapping_src_10018.lux_listing_id AS listing__lux_listing - FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 + lux_listing_mapping_src_10020.listing_id AS listing + , lux_listing_mapping_src_10020.lux_listing_id AS lux_listing + , lux_listing_mapping_src_10020.lux_listing_id AS listing__lux_listing + FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10020 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -364,54 +364,54 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'lux_listings' SELECT - lux_listings_src_10019.valid_from AS window_start__day - , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS window_start__week - , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month - , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter - , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year - , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS window_start__extract_year - , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter - , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS window_start__extract_month - , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS window_start__extract_day - , EXTRACT(isodow FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow - , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy - , lux_listings_src_10019.valid_to AS window_end__day - , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week - , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month - , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter - , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year - , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS window_end__extract_year - , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter - , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS window_end__extract_month - , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS window_end__extract_day - , EXTRACT(isodow FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow - , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy - , lux_listings_src_10019.is_confirmed_lux - , lux_listings_src_10019.valid_from AS lux_listing__window_start__day - , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week - , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month - , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter - , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year - , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year - , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter - , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month - , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day - , EXTRACT(isodow FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow - , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy - , lux_listings_src_10019.valid_to AS lux_listing__window_end__day - , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week - , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month - , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter - , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year - , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year - , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter - , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month - , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day - , EXTRACT(isodow FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow - , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy - , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux - , lux_listings_src_10019.lux_listing_id AS lux_listing - FROM ***************************.dim_lux_listings lux_listings_src_10019 + lux_listings_src_10021.valid_from AS window_start__day + , DATE_TRUNC('week', lux_listings_src_10021.valid_from) AS window_start__week + , DATE_TRUNC('month', lux_listings_src_10021.valid_from) AS window_start__month + , DATE_TRUNC('quarter', lux_listings_src_10021.valid_from) AS window_start__quarter + , DATE_TRUNC('year', lux_listings_src_10021.valid_from) AS window_start__year + , EXTRACT(year FROM lux_listings_src_10021.valid_from) AS window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10021.valid_from) AS window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10021.valid_from) AS window_start__extract_month + , EXTRACT(day FROM lux_listings_src_10021.valid_from) AS window_start__extract_day + , EXTRACT(isodow FROM lux_listings_src_10021.valid_from) AS window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10021.valid_from) AS window_start__extract_doy + , lux_listings_src_10021.valid_to AS window_end__day + , DATE_TRUNC('week', lux_listings_src_10021.valid_to) AS window_end__week + , DATE_TRUNC('month', lux_listings_src_10021.valid_to) AS window_end__month + , DATE_TRUNC('quarter', lux_listings_src_10021.valid_to) AS window_end__quarter + , DATE_TRUNC('year', lux_listings_src_10021.valid_to) AS window_end__year + , EXTRACT(year FROM lux_listings_src_10021.valid_to) AS window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10021.valid_to) AS window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10021.valid_to) AS window_end__extract_month + , EXTRACT(day FROM lux_listings_src_10021.valid_to) AS window_end__extract_day + , EXTRACT(isodow FROM lux_listings_src_10021.valid_to) AS window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10021.valid_to) AS window_end__extract_doy + , lux_listings_src_10021.is_confirmed_lux + , lux_listings_src_10021.valid_from AS lux_listing__window_start__day + , DATE_TRUNC('week', lux_listings_src_10021.valid_from) AS lux_listing__window_start__week + , DATE_TRUNC('month', lux_listings_src_10021.valid_from) AS lux_listing__window_start__month + , DATE_TRUNC('quarter', lux_listings_src_10021.valid_from) AS lux_listing__window_start__quarter + , DATE_TRUNC('year', lux_listings_src_10021.valid_from) AS lux_listing__window_start__year + , EXTRACT(year FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(day FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(isodow FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10021.valid_from) AS lux_listing__window_start__extract_doy + , lux_listings_src_10021.valid_to AS lux_listing__window_end__day + , DATE_TRUNC('week', lux_listings_src_10021.valid_to) AS lux_listing__window_end__week + , DATE_TRUNC('month', lux_listings_src_10021.valid_to) AS lux_listing__window_end__month + , DATE_TRUNC('quarter', lux_listings_src_10021.valid_to) AS lux_listing__window_end__quarter + , DATE_TRUNC('year', lux_listings_src_10021.valid_to) AS lux_listing__window_end__year + , EXTRACT(year FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(day FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(isodow FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10021.valid_to) AS lux_listing__window_end__extract_doy + , lux_listings_src_10021.is_confirmed_lux AS lux_listing__is_confirmed_lux + , lux_listings_src_10021.lux_listing_id AS lux_listing + FROM ***************************.dim_lux_listings lux_listings_src_10021 ) subq_4 ) subq_5 ON diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql index add7e259ab..16470814e6 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -16,7 +16,7 @@ FROM ( DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_10015 + FROM ***************************.fct_bookings bookings_source_src_10017 ) subq_13 LEFT OUTER JOIN ( -- Join Standard Outputs @@ -26,15 +26,15 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - lux_listings_src_10019.valid_from AS lux_listing__window_start__day - , lux_listings_src_10019.valid_to AS lux_listing__window_end__day - , lux_listing_mapping_src_10018.listing_id AS listing - , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux - FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 + lux_listings_src_10021.valid_from AS lux_listing__window_start__day + , lux_listings_src_10021.valid_to AS lux_listing__window_end__day + , lux_listing_mapping_src_10020.listing_id AS listing + , lux_listings_src_10021.is_confirmed_lux AS lux_listing__is_confirmed_lux + FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10020 LEFT OUTER JOIN - ***************************.dim_lux_listings lux_listings_src_10019 + ***************************.dim_lux_listings lux_listings_src_10021 ON - lux_listing_mapping_src_10018.lux_listing_id = lux_listings_src_10019.lux_listing_id + lux_listing_mapping_src_10020.lux_listing_id = lux_listings_src_10021.lux_listing_id ) subq_18 ON ( diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql index 66555fd231..317c69a37f 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql @@ -93,55 +93,55 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'account_month_txns' SELECT - account_month_txns_src_10010.txn_count - , DATE_TRUNC('day', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy - , DATE_TRUNC('day', account_month_txns_src_10010.ds) AS ds__day - , 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 - , EXTRACT(year FROM account_month_txns_src_10010.ds) AS ds__extract_year - , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS ds__extract_quarter - , EXTRACT(month FROM account_month_txns_src_10010.ds) AS ds__extract_month - , EXTRACT(day FROM account_month_txns_src_10010.ds) AS ds__extract_day - , EXTRACT(isodow FROM account_month_txns_src_10010.ds) AS ds__extract_dow - , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS ds__extract_doy - , account_month_txns_src_10010.account_month - , DATE_TRUNC('day', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__day - , 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 - , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(isodow FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow - , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy - , DATE_TRUNC('day', account_month_txns_src_10010.ds) AS account_id__ds__day - , 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 - , EXTRACT(year FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year - , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter - , EXTRACT(month FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month - , EXTRACT(day FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day - , EXTRACT(isodow FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow - , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy - , 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 + , DATE_TRUNC('day', account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10012.ds_partitioned) AS ds_partitioned__extract_doy + , DATE_TRUNC('day', account_month_txns_src_10012.ds) AS ds__day + , 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 + , EXTRACT(year FROM account_month_txns_src_10012.ds) AS ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10012.ds) AS ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10012.ds) AS ds__extract_month + , EXTRACT(day FROM account_month_txns_src_10012.ds) AS ds__extract_day + , EXTRACT(isodow FROM account_month_txns_src_10012.ds) AS ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10012.ds) AS ds__extract_doy + , account_month_txns_src_10012.account_month + , DATE_TRUNC('day', account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__day + , 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 + , EXTRACT(year FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(day FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(isodow FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10012.ds_partitioned) AS account_id__ds_partitioned__extract_doy + , DATE_TRUNC('day', account_month_txns_src_10012.ds) AS account_id__ds__day + , 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 + , EXTRACT(year FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_month + , EXTRACT(day FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_day + , EXTRACT(isodow FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10012.ds) AS account_id__ds__extract_doy + , 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 @@ -212,48 +212,48 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'bridge_table' SELECT - bridge_table_src_10011.extra_dim - , DATE_TRUNC('day', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy - , bridge_table_src_10011.extra_dim AS account_id__extra_dim - , DATE_TRUNC('day', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__day - , 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 - , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(isodow FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow - , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy - , bridge_table_src_10011.extra_dim AS bridge_account__extra_dim - , DATE_TRUNC('day', bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__day - , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__week - , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__month - , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__quarter - , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__year - , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_year - , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_quarter - , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_month - , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_day - , EXTRACT(isodow FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_dow - , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS bridge_account__ds_partitioned__extract_doy - , bridge_table_src_10011.account_id - , bridge_table_src_10011.customer_id - , bridge_table_src_10011.customer_id AS account_id__customer_id - , bridge_table_src_10011.account_id AS bridge_account__account_id - , bridge_table_src_10011.customer_id AS bridge_account__customer_id - FROM ***************************.bridge_table bridge_table_src_10011 + bridge_table_src_10013.extra_dim + , DATE_TRUNC('day', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy + , bridge_table_src_10013.extra_dim AS account_id__extra_dim + , DATE_TRUNC('day', bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__day + , 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 + , EXTRACT(year FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(day FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(isodow FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10013.ds_partitioned) AS account_id__ds_partitioned__extract_doy + , bridge_table_src_10013.extra_dim AS bridge_account__extra_dim + , DATE_TRUNC('day', bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__day + , DATE_TRUNC('week', bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__week + , DATE_TRUNC('month', bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__month + , DATE_TRUNC('quarter', bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__quarter + , DATE_TRUNC('year', bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__year + , EXTRACT(year FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_month + , EXTRACT(day FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_day + , EXTRACT(isodow FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10013.ds_partitioned) AS bridge_account__ds_partitioned__extract_doy + , bridge_table_src_10013.account_id + , bridge_table_src_10013.customer_id + , bridge_table_src_10013.customer_id AS account_id__customer_id + , bridge_table_src_10013.account_id AS bridge_account__account_id + , bridge_table_src_10013.customer_id AS bridge_account__customer_id + FROM ***************************.bridge_table bridge_table_src_10013 ) subq_3 LEFT OUTER JOIN ( -- Pass Only Elements: @@ -315,34 +315,34 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'customer_table' SELECT - customer_table_src_10013.customer_name - , customer_table_src_10013.customer_atomic_weight - , DATE_TRUNC('day', customer_table_src_10013.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy - , customer_table_src_10013.customer_name AS customer_id__customer_name - , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight - , DATE_TRUNC('day', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__day - , 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 - , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year - , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter - , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month - , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day - , EXTRACT(isodow FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow - , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy - , 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 + , DATE_TRUNC('day', customer_table_src_10015.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10015.ds_partitioned) AS ds_partitioned__extract_doy + , customer_table_src_10015.customer_name AS customer_id__customer_name + , customer_table_src_10015.customer_atomic_weight AS customer_id__customer_atomic_weight + , DATE_TRUNC('day', customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__day + , 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 + , EXTRACT(year FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(day FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(isodow FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10015.ds_partitioned) AS customer_id__ds_partitioned__extract_doy + , 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_query_rendering.py/SqlQueryPlan/Postgres/test_multihop_node__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multihop_node__plan0_optimized.sql index 8a42052413..65d688b745 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multihop_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/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__day', 'account_id'] SELECT - DATE_TRUNC('day', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__day - , 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 + DATE_TRUNC('day', bridge_table_src_10013.ds_partitioned) AS ds_partitioned__day + , 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 ( - DATE_TRUNC('day', bridge_table_src_10011.ds_partitioned) = DATE_TRUNC('day', customer_table_src_10013.ds_partitioned) + DATE_TRUNC('day', bridge_table_src_10013.ds_partitioned) = DATE_TRUNC('day', 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 ( - DATE_TRUNC('day', account_month_txns_src_10010.ds_partitioned) = subq_18.ds_partitioned__day + DATE_TRUNC('day', account_month_txns_src_10012.ds_partitioned) = subq_18.ds_partitioned__day ) GROUP BY subq_18.customer_id__customer_name diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql index 7ad1c04247..6552f995c8 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql @@ -473,62 +473,62 @@ CROSS JOIN ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , 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 - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , 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 - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , 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 + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , 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 + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , 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__day BETWEEN '2020-01-01' AND '2020-01-01' diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0_optimized.sql index 631546edf7..5fdefdb6a7 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0_optimized.sql @@ -25,6 +25,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 DATE_TRUNC('day', created_at) BETWEEN '2020-01-01' AND '2020-01-01' ) subq_23 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql index 1673729a9a..166092a420 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql @@ -96,56 +96,56 @@ FROM ( -- Read Elements From Semantic Model 'id_verifications' SELECT 1 AS identity_verifications - , DATE_TRUNC('day', id_verifications_src_10003.ds) AS ds__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds) AS ds__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy - , DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy - , id_verifications_src_10003.verification_type - , DATE_TRUNC('day', id_verifications_src_10003.ds) AS verification__ds__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy - , DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__day - , 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 - , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(isodow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow - , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy - , 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 + , DATE_TRUNC('day', id_verifications_src_10004.ds) AS ds__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds) AS ds__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds) AS ds__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds) AS ds__extract_doy + , DATE_TRUNC('day', id_verifications_src_10004.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds_partitioned) AS ds_partitioned__extract_doy + , id_verifications_src_10004.verification_type + , DATE_TRUNC('day', id_verifications_src_10004.ds) AS verification__ds__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds) AS verification__ds__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds) AS verification__ds__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds) AS verification__ds__extract_doy + , DATE_TRUNC('day', id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__day + , 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 + , EXTRACT(year FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(day FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(isodow FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10004.ds_partitioned) AS verification__ds_partitioned__extract_doy + , 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 @@ -159,76 +159,76 @@ FROM ( FROM ( -- Read Elements From Semantic Model 'users_ds_source' SELECT - DATE_TRUNC('day', users_ds_source_src_10007.ds) AS ds__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.ds) AS ds__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS ds__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.ds) AS ds__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.ds) AS ds__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.ds) AS ds__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS ds__extract_doy - , DATE_TRUNC('day', users_ds_source_src_10007.created_at) AS created_at__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS created_at__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy - , DATE_TRUNC('day', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy - , users_ds_source_src_10007.home_state - , DATE_TRUNC('day', users_ds_source_src_10007.ds) AS user__ds__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.ds) AS user__ds__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.ds) AS user__ds__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.ds) AS user__ds__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy - , DATE_TRUNC('day', users_ds_source_src_10007.created_at) AS user__created_at__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy - , DATE_TRUNC('day', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__day - , 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 - , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year - , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter - , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month - , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day - , EXTRACT(isodow FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow - , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy - , 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 + DATE_TRUNC('day', users_ds_source_src_10008.ds) AS ds__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.ds) AS ds__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.ds) AS ds__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.ds) AS ds__extract_doy + , DATE_TRUNC('day', users_ds_source_src_10008.created_at) AS created_at__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.created_at) AS created_at__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.created_at) AS created_at__extract_doy + , DATE_TRUNC('day', users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.ds_partitioned) AS ds_partitioned__extract_doy + , users_ds_source_src_10008.home_state + , DATE_TRUNC('day', users_ds_source_src_10008.ds) AS user__ds__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.ds) AS user__ds__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.ds) AS user__ds__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.ds) AS user__ds__extract_doy + , DATE_TRUNC('day', users_ds_source_src_10008.created_at) AS user__created_at__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.created_at) AS user__created_at__extract_doy + , DATE_TRUNC('day', users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__day + , 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 + , EXTRACT(year FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(day FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(isodow FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10008.ds_partitioned) AS user__ds_partitioned__extract_doy + , 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_query_rendering.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0_optimized.sql index c15982d861..b52d743037 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/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 Semantic Model 'id_verifications' @@ -15,15 +15,15 @@ FROM ( DATE_TRUNC('day', ds_partitioned) AS ds_partitioned__day , 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__day = DATE_TRUNC('day', users_ds_source_src_10007.ds_partitioned) + subq_10.ds_partitioned__day = DATE_TRUNC('day', 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_semantic_model_container.py/dict/test_get_names__result0.txt b/metricflow/test/snapshots/test_semantic_model_container.py/dict/test_get_names__result0.txt index 306ae39392..e58aa63d8c 100644 --- a/metricflow/test/snapshots/test_semantic_model_container.py/dict/test_get_names__result0.txt +++ b/metricflow/test/snapshots/test_semantic_model_container.py/dict/test_get_names__result0.txt @@ -11,6 +11,7 @@ 'is_instant', 'is_lux_latest', 'paid_at', + 'referrer_id', 'verification_type'], 'measure_references': ['account_balance', 'approximate_continuous_booking_value_p99', @@ -21,6 +22,8 @@ 'booking_value', 'booking_value_p99', 'bookings', + 'buyers', + 'buys', 'current_account_balance_by_user', 'discrete_booking_value_p99', 'identity_verifications', @@ -34,11 +37,15 @@ 'smallest_listing', 'total_account_balance_first_day', 'txn_revenue', - 'views'], + 'views', + 'visitors', + 'visits'], 'entity_references': ['company', 'guest', 'host', 'listing', 'lux_listing', + 'session', + 'session_id', 'user', 'verification']} diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfp_0.xml index a22f6531b8..17e62c62b1 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfp_0.xml @@ -79,7 +79,7 @@ - + @@ -96,12 +96,12 @@ - + - + @@ -185,7 +185,7 @@ - + @@ -202,12 +202,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfp_0.xml index 85e26dc807..3b2271cd10 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfp_0.xml @@ -43,7 +43,7 @@ - + @@ -84,12 +84,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfp_0.xml index fc92635b40..3e04c2ee86 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfp_0.xml @@ -56,7 +56,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -163,7 +163,7 @@ - + @@ -209,7 +209,7 @@ - + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfp_0.xml index b4deae8ae0..59303afd6a 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfp_0.xml @@ -43,7 +43,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -130,12 +130,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 c418de8aab..a6c6b3266c 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 @@ -43,7 +43,7 @@ - + @@ -135,7 +135,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 03b6f242b8..0ca8d0374c 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 @@ -53,7 +53,7 @@ - + @@ -99,7 +99,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 ca91324ad9..6165b95d45 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 @@ -43,7 +43,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -148,7 +148,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 79228ef5a8..5ef9aedb74 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 @@ -66,7 +66,7 @@ - + @@ -112,7 +112,7 @@ - + @@ -160,7 +160,7 @@ - + @@ -206,7 +206,7 @@ - +