diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql index 4bd9dd2362..46ddf43a75 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql @@ -12,17 +12,17 @@ SELECT , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS ds__extract_dow , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS ds__extract_doy - , DATE_TRUNC(revenue_src_10007.created_at, day) AS company__ds__day - , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS company__ds__week - , DATE_TRUNC(revenue_src_10007.created_at, month) AS company__ds__month - , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS company__ds__quarter - , DATE_TRUNC(revenue_src_10007.created_at, year) 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 - , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS company__ds__extract_dow - , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC(revenue_src_10007.created_at, day) AS revenue_instance__ds__day + , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS revenue_instance__ds__week + , DATE_TRUNC(revenue_src_10007.created_at, month) AS revenue_instance__ds__month + , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS revenue_instance__ds__quarter + , DATE_TRUNC(revenue_src_10007.created_at, year) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS revenue_instance__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql index 94cb5e96f9..ccb8ec6b2f 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql @@ -12,17 +12,17 @@ SELECT , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAYOFWEEK_ISO 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(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 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 b86ca7f0bc..a79579b4d0 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 @@ -12,17 +12,17 @@ SELECT , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 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 b86ca7f0bc..a79579b4d0 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 @@ -12,17 +12,17 @@ SELECT , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql index 6ce9b03523..810035547f 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql @@ -12,17 +12,17 @@ SELECT , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END 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 - , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql index c1b61e86bb..e2bf702863 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql @@ -12,17 +12,17 @@ SELECT , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(dayofweekiso 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(dayofweekiso FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(dayofweekiso FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Trino/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Trino/test_convert_query_semantic_model__plan0.sql index b615260818..6bc4618ba3 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Trino/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Trino/test_convert_query_semantic_model__plan0.sql @@ -12,17 +12,17 @@ SELECT , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAY_OF_WEEK 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(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql index de71c5fb21..7f005cf3f9 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS ds__extract_dow , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS ds__extract_doy - , DATE_TRUNC(revenue_src_10007.created_at, day) AS company__ds__day - , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS company__ds__week - , DATE_TRUNC(revenue_src_10007.created_at, month) AS company__ds__month - , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS company__ds__quarter - , DATE_TRUNC(revenue_src_10007.created_at, year) 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 - , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS company__ds__extract_dow - , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC(revenue_src_10007.created_at, day) AS revenue_instance__ds__day + , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS revenue_instance__ds__week + , DATE_TRUNC(revenue_src_10007.created_at, month) AS revenue_instance__ds__month + , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS revenue_instance__ds__quarter + , DATE_TRUNC(revenue_src_10007.created_at, year) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS revenue_instance__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql index 0d2e548a31..250880e167 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS ds__extract_dow , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS ds__extract_doy - , DATE_TRUNC(revenue_src_10007.created_at, day) AS company__ds__day - , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS company__ds__week - , DATE_TRUNC(revenue_src_10007.created_at, month) AS company__ds__month - , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS company__ds__quarter - , DATE_TRUNC(revenue_src_10007.created_at, year) 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 - , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS company__ds__extract_dow - , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC(revenue_src_10007.created_at, day) AS revenue_instance__ds__day + , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS revenue_instance__ds__week + , DATE_TRUNC(revenue_src_10007.created_at, month) AS revenue_instance__ds__month + , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS revenue_instance__ds__quarter + , DATE_TRUNC(revenue_src_10007.created_at, year) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS revenue_instance__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql index ad2d825f25..155326e86a 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql @@ -24,17 +24,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -47,7 +47,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -64,19 +64,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS ds__extract_dow , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS ds__extract_doy - , DATE_TRUNC(revenue_src_10007.created_at, day) AS company__ds__day - , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS company__ds__week - , DATE_TRUNC(revenue_src_10007.created_at, month) AS company__ds__month - , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS company__ds__quarter - , DATE_TRUNC(revenue_src_10007.created_at, year) 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 - , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS company__ds__extract_dow - , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC(revenue_src_10007.created_at, day) AS revenue_instance__ds__day + , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS revenue_instance__ds__week + , DATE_TRUNC(revenue_src_10007.created_at, month) AS revenue_instance__ds__month + , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS revenue_instance__ds__quarter + , DATE_TRUNC(revenue_src_10007.created_at, year) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS revenue_instance__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql index 812a5a3df7..44da0117a6 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS ds__extract_dow , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS ds__extract_doy - , DATE_TRUNC(revenue_src_10007.created_at, day) AS company__ds__day - , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS company__ds__week - , DATE_TRUNC(revenue_src_10007.created_at, month) AS company__ds__month - , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS company__ds__quarter - , DATE_TRUNC(revenue_src_10007.created_at, year) 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 - , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS company__ds__extract_dow - , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC(revenue_src_10007.created_at, day) AS revenue_instance__ds__day + , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS revenue_instance__ds__week + , DATE_TRUNC(revenue_src_10007.created_at, month) AS revenue_instance__ds__month + , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS revenue_instance__ds__quarter + , DATE_TRUNC(revenue_src_10007.created_at, year) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS revenue_instance__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index d5a1be0f94..b022ba4916 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,7 +50,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -66,17 +66,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -89,7 +89,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -106,19 +106,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS ds__extract_dow , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS ds__extract_doy - , DATE_TRUNC(revenue_src_10007.created_at, day) AS company__ds__day - , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS company__ds__week - , DATE_TRUNC(revenue_src_10007.created_at, month) AS company__ds__month - , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS company__ds__quarter - , DATE_TRUNC(revenue_src_10007.created_at, year) 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 - , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS company__ds__extract_dow - , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC(revenue_src_10007.created_at, day) AS revenue_instance__ds__day + , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS revenue_instance__ds__week + , DATE_TRUNC(revenue_src_10007.created_at, month) AS revenue_instance__ds__month + , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS revenue_instance__ds__quarter + , DATE_TRUNC(revenue_src_10007.created_at, year) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS revenue_instance__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql index 8be394c2d3..de43786db9 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql @@ -33,17 +33,17 @@ FROM ( , subq_2.ds__extract_day AS ds__extract_day , subq_2.ds__extract_dow AS ds__extract_dow , subq_2.ds__extract_doy AS ds__extract_doy - , subq_2.company__ds__day AS company__ds__day - , subq_2.company__ds__week AS company__ds__week - , subq_2.company__ds__month AS company__ds__month - , subq_2.company__ds__quarter AS company__ds__quarter - , subq_2.company__ds__year AS company__ds__year - , subq_2.company__ds__extract_year AS company__ds__extract_year - , subq_2.company__ds__extract_quarter AS company__ds__extract_quarter - , subq_2.company__ds__extract_month AS company__ds__extract_month - , subq_2.company__ds__extract_day AS company__ds__extract_day - , subq_2.company__ds__extract_dow AS company__ds__extract_dow - , subq_2.company__ds__extract_doy AS company__ds__extract_doy + , subq_2.revenue_instance__ds__day AS revenue_instance__ds__day + , subq_2.revenue_instance__ds__week AS revenue_instance__ds__week + , subq_2.revenue_instance__ds__month AS revenue_instance__ds__month + , subq_2.revenue_instance__ds__quarter AS revenue_instance__ds__quarter + , subq_2.revenue_instance__ds__year AS revenue_instance__ds__year + , subq_2.revenue_instance__ds__extract_year AS revenue_instance__ds__extract_year + , subq_2.revenue_instance__ds__extract_quarter AS revenue_instance__ds__extract_quarter + , subq_2.revenue_instance__ds__extract_month AS revenue_instance__ds__extract_month + , subq_2.revenue_instance__ds__extract_day AS revenue_instance__ds__extract_day + , subq_2.revenue_instance__ds__extract_dow AS revenue_instance__ds__extract_dow + , subq_2.revenue_instance__ds__extract_doy AS revenue_instance__ds__extract_doy , subq_2.metric_time__week AS metric_time__week , subq_2.metric_time__month AS metric_time__month , subq_2.metric_time__quarter AS metric_time__quarter @@ -55,7 +55,7 @@ FROM ( , subq_2.metric_time__extract_dow AS metric_time__extract_dow , subq_2.metric_time__extract_doy AS metric_time__extract_doy , subq_2.user AS user - , subq_2.company__user AS company__user + , subq_2.revenue_instance__user AS revenue_instance__user , subq_2.txn_revenue AS txn_revenue FROM ( -- Date Spine @@ -78,17 +78,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -101,7 +101,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -117,17 +117,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -140,7 +140,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -157,19 +157,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS ds__extract_dow , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS ds__extract_doy - , DATE_TRUNC(revenue_src_10007.created_at, day) AS company__ds__day - , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS company__ds__week - , DATE_TRUNC(revenue_src_10007.created_at, month) AS company__ds__month - , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS company__ds__quarter - , DATE_TRUNC(revenue_src_10007.created_at, year) 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 - , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS company__ds__extract_dow - , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC(revenue_src_10007.created_at, day) AS revenue_instance__ds__day + , DATE_TRUNC(revenue_src_10007.created_at, isoweek) AS revenue_instance__ds__week + , DATE_TRUNC(revenue_src_10007.created_at, month) AS revenue_instance__ds__month + , DATE_TRUNC(revenue_src_10007.created_at, quarter) AS revenue_instance__ds__quarter + , DATE_TRUNC(revenue_src_10007.created_at, year) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , IF(EXTRACT(dayofweek FROM revenue_src_10007.created_at) = 1, 7, EXTRACT(dayofweek FROM revenue_src_10007.created_at) - 1) AS revenue_instance__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql index 8e11af172d..5cc1f0afe1 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAYOFWEEK_ISO 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(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql index de8d290b71..def2c283a9 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAYOFWEEK_ISO 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(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql index 5cd4d1796e..ad0955f14e 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql @@ -24,17 +24,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -47,7 +47,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -64,19 +64,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAYOFWEEK_ISO 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(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql index 86fa446aec..2a2124238b 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAYOFWEEK_ISO 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(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index cab6fd0874..bcf2a530ec 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,7 +50,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -66,17 +66,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -89,7 +89,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -106,19 +106,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAYOFWEEK_ISO 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(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql index c24b6f9a53..6656113e68 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql @@ -33,17 +33,17 @@ FROM ( , subq_2.ds__extract_day AS ds__extract_day , subq_2.ds__extract_dow AS ds__extract_dow , subq_2.ds__extract_doy AS ds__extract_doy - , subq_2.company__ds__day AS company__ds__day - , subq_2.company__ds__week AS company__ds__week - , subq_2.company__ds__month AS company__ds__month - , subq_2.company__ds__quarter AS company__ds__quarter - , subq_2.company__ds__year AS company__ds__year - , subq_2.company__ds__extract_year AS company__ds__extract_year - , subq_2.company__ds__extract_quarter AS company__ds__extract_quarter - , subq_2.company__ds__extract_month AS company__ds__extract_month - , subq_2.company__ds__extract_day AS company__ds__extract_day - , subq_2.company__ds__extract_dow AS company__ds__extract_dow - , subq_2.company__ds__extract_doy AS company__ds__extract_doy + , subq_2.revenue_instance__ds__day AS revenue_instance__ds__day + , subq_2.revenue_instance__ds__week AS revenue_instance__ds__week + , subq_2.revenue_instance__ds__month AS revenue_instance__ds__month + , subq_2.revenue_instance__ds__quarter AS revenue_instance__ds__quarter + , subq_2.revenue_instance__ds__year AS revenue_instance__ds__year + , subq_2.revenue_instance__ds__extract_year AS revenue_instance__ds__extract_year + , subq_2.revenue_instance__ds__extract_quarter AS revenue_instance__ds__extract_quarter + , subq_2.revenue_instance__ds__extract_month AS revenue_instance__ds__extract_month + , subq_2.revenue_instance__ds__extract_day AS revenue_instance__ds__extract_day + , subq_2.revenue_instance__ds__extract_dow AS revenue_instance__ds__extract_dow + , subq_2.revenue_instance__ds__extract_doy AS revenue_instance__ds__extract_doy , subq_2.metric_time__week AS metric_time__week , subq_2.metric_time__month AS metric_time__month , subq_2.metric_time__quarter AS metric_time__quarter @@ -55,7 +55,7 @@ FROM ( , subq_2.metric_time__extract_dow AS metric_time__extract_dow , subq_2.metric_time__extract_doy AS metric_time__extract_doy , subq_2.user AS user - , subq_2.company__user AS company__user + , subq_2.revenue_instance__user AS revenue_instance__user , subq_2.txn_revenue AS txn_revenue FROM ( -- Date Spine @@ -78,17 +78,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -101,7 +101,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -117,17 +117,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -140,7 +140,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -157,19 +157,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAYOFWEEK_ISO 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(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAYOFWEEK_ISO FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 8e782b48da..66a0fd96fc 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 @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 fb7c5634e7..986b6f3e1a 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 @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 cf42f8c8c9..3cb7e0e359 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 @@ -24,17 +24,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -47,7 +47,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -64,19 +64,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 2e2e9a1615..22875d88e5 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 @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 f8f9b92af1..752e167194 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 @@ -27,17 +27,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,7 +50,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -66,17 +66,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -89,7 +89,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -106,19 +106,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 b0b8fc7f6f..e1927750f3 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 @@ -33,17 +33,17 @@ FROM ( , subq_2.ds__extract_day AS ds__extract_day , subq_2.ds__extract_dow AS ds__extract_dow , subq_2.ds__extract_doy AS ds__extract_doy - , subq_2.company__ds__day AS company__ds__day - , subq_2.company__ds__week AS company__ds__week - , subq_2.company__ds__month AS company__ds__month - , subq_2.company__ds__quarter AS company__ds__quarter - , subq_2.company__ds__year AS company__ds__year - , subq_2.company__ds__extract_year AS company__ds__extract_year - , subq_2.company__ds__extract_quarter AS company__ds__extract_quarter - , subq_2.company__ds__extract_month AS company__ds__extract_month - , subq_2.company__ds__extract_day AS company__ds__extract_day - , subq_2.company__ds__extract_dow AS company__ds__extract_dow - , subq_2.company__ds__extract_doy AS company__ds__extract_doy + , subq_2.revenue_instance__ds__day AS revenue_instance__ds__day + , subq_2.revenue_instance__ds__week AS revenue_instance__ds__week + , subq_2.revenue_instance__ds__month AS revenue_instance__ds__month + , subq_2.revenue_instance__ds__quarter AS revenue_instance__ds__quarter + , subq_2.revenue_instance__ds__year AS revenue_instance__ds__year + , subq_2.revenue_instance__ds__extract_year AS revenue_instance__ds__extract_year + , subq_2.revenue_instance__ds__extract_quarter AS revenue_instance__ds__extract_quarter + , subq_2.revenue_instance__ds__extract_month AS revenue_instance__ds__extract_month + , subq_2.revenue_instance__ds__extract_day AS revenue_instance__ds__extract_day + , subq_2.revenue_instance__ds__extract_dow AS revenue_instance__ds__extract_dow + , subq_2.revenue_instance__ds__extract_doy AS revenue_instance__ds__extract_doy , subq_2.metric_time__week AS metric_time__week , subq_2.metric_time__month AS metric_time__month , subq_2.metric_time__quarter AS metric_time__quarter @@ -55,7 +55,7 @@ FROM ( , subq_2.metric_time__extract_dow AS metric_time__extract_dow , subq_2.metric_time__extract_doy AS metric_time__extract_doy , subq_2.user AS user - , subq_2.company__user AS company__user + , subq_2.revenue_instance__user AS revenue_instance__user , subq_2.txn_revenue AS txn_revenue FROM ( -- Date Spine @@ -78,17 +78,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -101,7 +101,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -117,17 +117,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -140,7 +140,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -157,19 +157,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 8e782b48da..66a0fd96fc 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 @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 fb7c5634e7..986b6f3e1a 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 @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 cf42f8c8c9..3cb7e0e359 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 @@ -24,17 +24,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -47,7 +47,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -64,19 +64,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 2e2e9a1615..22875d88e5 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 @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 f8f9b92af1..752e167194 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 @@ -27,17 +27,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,7 +50,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -66,17 +66,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -89,7 +89,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -106,19 +106,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 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 fe5aede2c9..3e6d2b2b50 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 @@ -33,17 +33,17 @@ FROM ( , subq_2.ds__extract_day AS ds__extract_day , subq_2.ds__extract_dow AS ds__extract_dow , subq_2.ds__extract_doy AS ds__extract_doy - , subq_2.company__ds__day AS company__ds__day - , subq_2.company__ds__week AS company__ds__week - , subq_2.company__ds__month AS company__ds__month - , subq_2.company__ds__quarter AS company__ds__quarter - , subq_2.company__ds__year AS company__ds__year - , subq_2.company__ds__extract_year AS company__ds__extract_year - , subq_2.company__ds__extract_quarter AS company__ds__extract_quarter - , subq_2.company__ds__extract_month AS company__ds__extract_month - , subq_2.company__ds__extract_day AS company__ds__extract_day - , subq_2.company__ds__extract_dow AS company__ds__extract_dow - , subq_2.company__ds__extract_doy AS company__ds__extract_doy + , subq_2.revenue_instance__ds__day AS revenue_instance__ds__day + , subq_2.revenue_instance__ds__week AS revenue_instance__ds__week + , subq_2.revenue_instance__ds__month AS revenue_instance__ds__month + , subq_2.revenue_instance__ds__quarter AS revenue_instance__ds__quarter + , subq_2.revenue_instance__ds__year AS revenue_instance__ds__year + , subq_2.revenue_instance__ds__extract_year AS revenue_instance__ds__extract_year + , subq_2.revenue_instance__ds__extract_quarter AS revenue_instance__ds__extract_quarter + , subq_2.revenue_instance__ds__extract_month AS revenue_instance__ds__extract_month + , subq_2.revenue_instance__ds__extract_day AS revenue_instance__ds__extract_day + , subq_2.revenue_instance__ds__extract_dow AS revenue_instance__ds__extract_dow + , subq_2.revenue_instance__ds__extract_doy AS revenue_instance__ds__extract_doy , subq_2.metric_time__week AS metric_time__week , subq_2.metric_time__month AS metric_time__month , subq_2.metric_time__quarter AS metric_time__quarter @@ -55,7 +55,7 @@ FROM ( , subq_2.metric_time__extract_dow AS metric_time__extract_dow , subq_2.metric_time__extract_doy AS metric_time__extract_doy , subq_2.user AS user - , subq_2.company__user AS company__user + , subq_2.revenue_instance__user AS revenue_instance__user , subq_2.txn_revenue AS txn_revenue FROM ( -- Date Spine @@ -78,17 +78,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -101,7 +101,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -117,17 +117,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -140,7 +140,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -157,19 +157,19 @@ FROM ( , 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 + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(isodow FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql index fd2e82bd9b..afe582d4d7 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END 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 - , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql index d7a6cea5e2..b9314d65c7 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END 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 - , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql index bf110f16b9..8bab2be98d 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql @@ -24,17 +24,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -47,7 +47,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -64,19 +64,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END 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 - , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql index 6c79a40275..3f97cd7147 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END 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 - , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 2f393acaab..8e9b39da23 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,7 +50,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -66,17 +66,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -89,7 +89,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -106,19 +106,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END 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 - , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql index cf1553ca5a..85a941fab7 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql @@ -33,17 +33,17 @@ FROM ( , subq_2.ds__extract_day AS ds__extract_day , subq_2.ds__extract_dow AS ds__extract_dow , subq_2.ds__extract_doy AS ds__extract_doy - , subq_2.company__ds__day AS company__ds__day - , subq_2.company__ds__week AS company__ds__week - , subq_2.company__ds__month AS company__ds__month - , subq_2.company__ds__quarter AS company__ds__quarter - , subq_2.company__ds__year AS company__ds__year - , subq_2.company__ds__extract_year AS company__ds__extract_year - , subq_2.company__ds__extract_quarter AS company__ds__extract_quarter - , subq_2.company__ds__extract_month AS company__ds__extract_month - , subq_2.company__ds__extract_day AS company__ds__extract_day - , subq_2.company__ds__extract_dow AS company__ds__extract_dow - , subq_2.company__ds__extract_doy AS company__ds__extract_doy + , subq_2.revenue_instance__ds__day AS revenue_instance__ds__day + , subq_2.revenue_instance__ds__week AS revenue_instance__ds__week + , subq_2.revenue_instance__ds__month AS revenue_instance__ds__month + , subq_2.revenue_instance__ds__quarter AS revenue_instance__ds__quarter + , subq_2.revenue_instance__ds__year AS revenue_instance__ds__year + , subq_2.revenue_instance__ds__extract_year AS revenue_instance__ds__extract_year + , subq_2.revenue_instance__ds__extract_quarter AS revenue_instance__ds__extract_quarter + , subq_2.revenue_instance__ds__extract_month AS revenue_instance__ds__extract_month + , subq_2.revenue_instance__ds__extract_day AS revenue_instance__ds__extract_day + , subq_2.revenue_instance__ds__extract_dow AS revenue_instance__ds__extract_dow + , subq_2.revenue_instance__ds__extract_doy AS revenue_instance__ds__extract_doy , subq_2.metric_time__week AS metric_time__week , subq_2.metric_time__month AS metric_time__month , subq_2.metric_time__quarter AS metric_time__quarter @@ -55,7 +55,7 @@ FROM ( , subq_2.metric_time__extract_dow AS metric_time__extract_dow , subq_2.metric_time__extract_doy AS metric_time__extract_doy , subq_2.user AS user - , subq_2.company__user AS company__user + , subq_2.revenue_instance__user AS revenue_instance__user , subq_2.txn_revenue AS txn_revenue FROM ( -- Date Spine @@ -78,17 +78,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -101,7 +101,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -117,17 +117,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -140,7 +140,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -157,19 +157,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END 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 - , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , CASE WHEN EXTRACT(dow FROM revenue_src_10007.created_at) = 0 THEN EXTRACT(dow FROM revenue_src_10007.created_at) + 7 ELSE EXTRACT(dow FROM revenue_src_10007.created_at) END AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql index 7d05945b26..10864085f5 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(dayofweekiso 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(dayofweekiso FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(dayofweekiso FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql index bc77d193e1..ba09b80dd3 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(dayofweekiso 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(dayofweekiso FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(dayofweekiso FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql index 4dae379c23..057237cd03 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql @@ -24,17 +24,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -47,7 +47,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -64,19 +64,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(dayofweekiso 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(dayofweekiso FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(dayofweekiso FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql index c7747a8b63..bc4a3866ac 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(dayofweekiso 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(dayofweekiso FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(dayofweekiso FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 0647e65d7f..de41b33d33 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,7 +50,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -66,17 +66,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -89,7 +89,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -106,19 +106,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(dayofweekiso 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(dayofweekiso FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(dayofweekiso FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql index 5f19de2215..8fb7c862dc 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql @@ -33,17 +33,17 @@ FROM ( , subq_2.ds__extract_day AS ds__extract_day , subq_2.ds__extract_dow AS ds__extract_dow , subq_2.ds__extract_doy AS ds__extract_doy - , subq_2.company__ds__day AS company__ds__day - , subq_2.company__ds__week AS company__ds__week - , subq_2.company__ds__month AS company__ds__month - , subq_2.company__ds__quarter AS company__ds__quarter - , subq_2.company__ds__year AS company__ds__year - , subq_2.company__ds__extract_year AS company__ds__extract_year - , subq_2.company__ds__extract_quarter AS company__ds__extract_quarter - , subq_2.company__ds__extract_month AS company__ds__extract_month - , subq_2.company__ds__extract_day AS company__ds__extract_day - , subq_2.company__ds__extract_dow AS company__ds__extract_dow - , subq_2.company__ds__extract_doy AS company__ds__extract_doy + , subq_2.revenue_instance__ds__day AS revenue_instance__ds__day + , subq_2.revenue_instance__ds__week AS revenue_instance__ds__week + , subq_2.revenue_instance__ds__month AS revenue_instance__ds__month + , subq_2.revenue_instance__ds__quarter AS revenue_instance__ds__quarter + , subq_2.revenue_instance__ds__year AS revenue_instance__ds__year + , subq_2.revenue_instance__ds__extract_year AS revenue_instance__ds__extract_year + , subq_2.revenue_instance__ds__extract_quarter AS revenue_instance__ds__extract_quarter + , subq_2.revenue_instance__ds__extract_month AS revenue_instance__ds__extract_month + , subq_2.revenue_instance__ds__extract_day AS revenue_instance__ds__extract_day + , subq_2.revenue_instance__ds__extract_dow AS revenue_instance__ds__extract_dow + , subq_2.revenue_instance__ds__extract_doy AS revenue_instance__ds__extract_doy , subq_2.metric_time__week AS metric_time__week , subq_2.metric_time__month AS metric_time__month , subq_2.metric_time__quarter AS metric_time__quarter @@ -55,7 +55,7 @@ FROM ( , subq_2.metric_time__extract_dow AS metric_time__extract_dow , subq_2.metric_time__extract_doy AS metric_time__extract_doy , subq_2.user AS user - , subq_2.company__user AS company__user + , subq_2.revenue_instance__user AS revenue_instance__user , subq_2.txn_revenue AS txn_revenue FROM ( -- Date Spine @@ -78,17 +78,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -101,7 +101,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -117,17 +117,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -140,7 +140,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -157,19 +157,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(dayofweekiso 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(dayofweekiso FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(dayofweekiso FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric__plan0.sql index 2f9b5fe681..9776f1a517 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAY_OF_WEEK 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(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_grain_to_date__plan0.sql index ca08f80e45..3556360138 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_grain_to_date__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAY_OF_WEEK 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(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_ds__plan0.sql index afce151a3d..454fd18994 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_ds__plan0.sql @@ -24,17 +24,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -47,7 +47,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -64,19 +64,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAY_OF_WEEK 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(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_window__plan0.sql index 5062fa6a66..a1ea30b6ee 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_window__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -50,7 +50,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -67,19 +67,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAY_OF_WEEK 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(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index f5cde6f1a4..14a299d6da 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -27,17 +27,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,7 +50,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -66,17 +66,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -89,7 +89,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -106,19 +106,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAY_OF_WEEK 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(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_with_time_constraint__plan0.sql index db1370b7a0..bea0ab183f 100644 --- a/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_metric_with_time_constraint__plan0.sql @@ -33,17 +33,17 @@ FROM ( , subq_2.ds__extract_day AS ds__extract_day , subq_2.ds__extract_dow AS ds__extract_dow , subq_2.ds__extract_doy AS ds__extract_doy - , subq_2.company__ds__day AS company__ds__day - , subq_2.company__ds__week AS company__ds__week - , subq_2.company__ds__month AS company__ds__month - , subq_2.company__ds__quarter AS company__ds__quarter - , subq_2.company__ds__year AS company__ds__year - , subq_2.company__ds__extract_year AS company__ds__extract_year - , subq_2.company__ds__extract_quarter AS company__ds__extract_quarter - , subq_2.company__ds__extract_month AS company__ds__extract_month - , subq_2.company__ds__extract_day AS company__ds__extract_day - , subq_2.company__ds__extract_dow AS company__ds__extract_dow - , subq_2.company__ds__extract_doy AS company__ds__extract_doy + , subq_2.revenue_instance__ds__day AS revenue_instance__ds__day + , subq_2.revenue_instance__ds__week AS revenue_instance__ds__week + , subq_2.revenue_instance__ds__month AS revenue_instance__ds__month + , subq_2.revenue_instance__ds__quarter AS revenue_instance__ds__quarter + , subq_2.revenue_instance__ds__year AS revenue_instance__ds__year + , subq_2.revenue_instance__ds__extract_year AS revenue_instance__ds__extract_year + , subq_2.revenue_instance__ds__extract_quarter AS revenue_instance__ds__extract_quarter + , subq_2.revenue_instance__ds__extract_month AS revenue_instance__ds__extract_month + , subq_2.revenue_instance__ds__extract_day AS revenue_instance__ds__extract_day + , subq_2.revenue_instance__ds__extract_dow AS revenue_instance__ds__extract_dow + , subq_2.revenue_instance__ds__extract_doy AS revenue_instance__ds__extract_doy , subq_2.metric_time__week AS metric_time__week , subq_2.metric_time__month AS metric_time__month , subq_2.metric_time__quarter AS metric_time__quarter @@ -55,7 +55,7 @@ FROM ( , subq_2.metric_time__extract_dow AS metric_time__extract_dow , subq_2.metric_time__extract_doy AS metric_time__extract_doy , subq_2.user AS user - , subq_2.company__user AS company__user + , subq_2.revenue_instance__user AS revenue_instance__user , subq_2.txn_revenue AS txn_revenue FROM ( -- Date Spine @@ -78,17 +78,17 @@ FROM ( , subq_1.ds__extract_day , subq_1.ds__extract_dow , subq_1.ds__extract_doy - , subq_1.company__ds__day - , subq_1.company__ds__week - , subq_1.company__ds__month - , subq_1.company__ds__quarter - , subq_1.company__ds__year - , subq_1.company__ds__extract_year - , subq_1.company__ds__extract_quarter - , subq_1.company__ds__extract_month - , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dow - , subq_1.company__ds__extract_doy + , subq_1.revenue_instance__ds__day + , subq_1.revenue_instance__ds__week + , subq_1.revenue_instance__ds__month + , subq_1.revenue_instance__ds__quarter + , subq_1.revenue_instance__ds__year + , subq_1.revenue_instance__ds__extract_year + , subq_1.revenue_instance__ds__extract_quarter + , subq_1.revenue_instance__ds__extract_month + , subq_1.revenue_instance__ds__extract_day + , subq_1.revenue_instance__ds__extract_dow + , subq_1.revenue_instance__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -101,7 +101,7 @@ FROM ( , subq_1.metric_time__extract_dow , subq_1.metric_time__extract_doy , subq_1.user - , subq_1.company__user + , subq_1.revenue_instance__user , subq_1.txn_revenue FROM ( -- Metric Time Dimension 'ds' @@ -117,17 +117,17 @@ FROM ( , subq_0.ds__extract_day , subq_0.ds__extract_dow , subq_0.ds__extract_doy - , subq_0.company__ds__day - , subq_0.company__ds__week - , subq_0.company__ds__month - , subq_0.company__ds__quarter - , subq_0.company__ds__year - , subq_0.company__ds__extract_year - , subq_0.company__ds__extract_quarter - , subq_0.company__ds__extract_month - , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dow - , subq_0.company__ds__extract_doy + , subq_0.revenue_instance__ds__day + , subq_0.revenue_instance__ds__week + , subq_0.revenue_instance__ds__month + , subq_0.revenue_instance__ds__quarter + , subq_0.revenue_instance__ds__year + , subq_0.revenue_instance__ds__extract_year + , subq_0.revenue_instance__ds__extract_quarter + , subq_0.revenue_instance__ds__extract_month + , subq_0.revenue_instance__ds__extract_day + , subq_0.revenue_instance__ds__extract_dow + , subq_0.revenue_instance__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 @@ -140,7 +140,7 @@ 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.company__user + , subq_0.revenue_instance__user , subq_0.txn_revenue FROM ( -- Read Elements From Semantic Model 'revenue' @@ -157,19 +157,19 @@ FROM ( , EXTRACT(day FROM revenue_src_10007.created_at) AS ds__extract_day , EXTRACT(DAY_OF_WEEK 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(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS company__ds__extract_dow - , EXTRACT(doy FROM revenue_src_10007.created_at) AS company__ds__extract_doy + , DATE_TRUNC('day', revenue_src_10007.created_at) AS revenue_instance__ds__day + , DATE_TRUNC('week', revenue_src_10007.created_at) AS revenue_instance__ds__week + , DATE_TRUNC('month', revenue_src_10007.created_at) AS revenue_instance__ds__month + , DATE_TRUNC('quarter', revenue_src_10007.created_at) AS revenue_instance__ds__quarter + , DATE_TRUNC('year', revenue_src_10007.created_at) AS revenue_instance__ds__year + , EXTRACT(year FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_month + , EXTRACT(day FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_day + , EXTRACT(DAY_OF_WEEK FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10007.created_at) AS revenue_instance__ds__extract_doy , revenue_src_10007.user_id AS user - , revenue_src_10007.user_id AS company__user + , revenue_src_10007.user_id AS revenue_instance__user FROM ***************************.fct_revenue revenue_src_10007 ) subq_0 ) subq_1 diff --git a/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt b/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt index a1c7637f31..fe878a0e73 100644 --- a/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt +++ b/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt @@ -1,16 +1,4 @@ -['company__ds__day', - 'company__ds__extract_day', - 'company__ds__extract_dow', - 'company__ds__extract_doy', - 'company__ds__extract_month', - 'company__ds__extract_quarter', - 'company__ds__extract_year', - 'company__ds__month', - 'company__ds__quarter', - 'company__ds__week', - 'company__ds__year', - 'company__user', - 'ds__day', +['ds__day', 'ds__extract_day', 'ds__extract_dow', 'ds__extract_doy', @@ -21,6 +9,18 @@ 'ds__quarter', 'ds__week', 'ds__year', + 'revenue_instance__ds__day', + 'revenue_instance__ds__extract_day', + 'revenue_instance__ds__extract_dow', + 'revenue_instance__ds__extract_doy', + 'revenue_instance__ds__extract_month', + 'revenue_instance__ds__extract_quarter', + 'revenue_instance__ds__extract_year', + 'revenue_instance__ds__month', + 'revenue_instance__ds__quarter', + 'revenue_instance__ds__week', + 'revenue_instance__ds__year', + 'revenue_instance__user', 'txn_revenue', 'user', 'user__ds_latest__day',