diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/BigQuery/test_min_max_only_categorical__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/BigQuery/test_min_max_only_categorical__plan0.sql index 806230bab6..672a89d468 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/BigQuery/test_min_max_only_categorical__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/BigQuery/test_min_max_only_categorical__plan0.sql @@ -11,62 +11,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC(listings_latest_src_10004.created_at, day) AS ds__day - , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS ds__week - , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month - , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter - , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , IF(EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) = 1, 7, EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) - 1) AS ds__extract_dow - , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC(listings_latest_src_10004.created_at, day) AS created_at__day - , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week - , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month - , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter - , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , IF(EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) = 1, 7, EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) - 1) AS created_at__extract_dow - , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , DATE_TRUNC(listings_latest_src_10004.created_at, day) AS listing__ds__day - , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__ds__week - , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month - , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter - , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , IF(EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) = 1, 7, EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) - 1) AS listing__ds__extract_dow - , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC(listings_latest_src_10004.created_at, day) AS listing__created_at__day - , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week - , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month - , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter - , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , IF(EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) = 1, 7, EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) - 1) AS listing__created_at__extract_dow - , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , DATE_TRUNC(listings_latest_src_10005.created_at, day) AS ds__day + , DATE_TRUNC(listings_latest_src_10005.created_at, isoweek) AS ds__week + , DATE_TRUNC(listings_latest_src_10005.created_at, month) AS ds__month + , DATE_TRUNC(listings_latest_src_10005.created_at, quarter) AS ds__quarter + , DATE_TRUNC(listings_latest_src_10005.created_at, year) AS ds__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , IF(EXTRACT(dayofweek FROM listings_latest_src_10005.created_at) = 1, 7, EXTRACT(dayofweek FROM listings_latest_src_10005.created_at) - 1) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC(listings_latest_src_10005.created_at, day) AS created_at__day + , DATE_TRUNC(listings_latest_src_10005.created_at, isoweek) AS created_at__week + , DATE_TRUNC(listings_latest_src_10005.created_at, month) AS created_at__month + , DATE_TRUNC(listings_latest_src_10005.created_at, quarter) AS created_at__quarter + , DATE_TRUNC(listings_latest_src_10005.created_at, year) AS created_at__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , IF(EXTRACT(dayofweek FROM listings_latest_src_10005.created_at) = 1, 7, EXTRACT(dayofweek FROM listings_latest_src_10005.created_at) - 1) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , DATE_TRUNC(listings_latest_src_10005.created_at, day) AS listing__ds__day + , DATE_TRUNC(listings_latest_src_10005.created_at, isoweek) AS listing__ds__week + , DATE_TRUNC(listings_latest_src_10005.created_at, month) AS listing__ds__month + , DATE_TRUNC(listings_latest_src_10005.created_at, quarter) AS listing__ds__quarter + , DATE_TRUNC(listings_latest_src_10005.created_at, year) AS listing__ds__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , IF(EXTRACT(dayofweek FROM listings_latest_src_10005.created_at) = 1, 7, EXTRACT(dayofweek FROM listings_latest_src_10005.created_at) - 1) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC(listings_latest_src_10005.created_at, day) AS listing__created_at__day + , DATE_TRUNC(listings_latest_src_10005.created_at, isoweek) AS listing__created_at__week + , DATE_TRUNC(listings_latest_src_10005.created_at, month) AS listing__created_at__month + , DATE_TRUNC(listings_latest_src_10005.created_at, quarter) AS listing__created_at__quarter + , DATE_TRUNC(listings_latest_src_10005.created_at, year) AS listing__created_at__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , IF(EXTRACT(dayofweek FROM listings_latest_src_10005.created_at) = 1, 7, EXTRACT(dayofweek FROM listings_latest_src_10005.created_at) - 1) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_0 GROUP BY listing__country_latest diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/BigQuery/test_min_max_only_categorical__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/BigQuery/test_min_max_only_categorical__plan0_optimized.sql index 59ff42ff29..4e3a1bc063 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/BigQuery/test_min_max_only_categorical__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/BigQuery/test_min_max_only_categorical__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- ['listing__country_latest'] SELECT country AS listing__country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 GROUP BY listing__country_latest ) subq_3 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Databricks/test_min_max_only_categorical__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Databricks/test_min_max_only_categorical__plan0.sql index caeec2c18e..350734028b 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Databricks/test_min_max_only_categorical__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Databricks/test_min_max_only_categorical__plan0.sql @@ -11,62 +11,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK_ISO FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK_ISO FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK_ISO FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK_ISO FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_0 GROUP BY subq_0.listing__country_latest diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Databricks/test_min_max_only_categorical__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Databricks/test_min_max_only_categorical__plan0_optimized.sql index d17cb70a5a..42ca29108d 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Databricks/test_min_max_only_categorical__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Databricks/test_min_max_only_categorical__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- ['listing__country_latest'] SELECT country AS listing__country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 GROUP BY country ) subq_3 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_min_max_only_categorical__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_min_max_only_categorical__plan0.sql index 441a5e9559..9231224847 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_min_max_only_categorical__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_min_max_only_categorical__plan0.sql @@ -11,62 +11,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(isodow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(isodow FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_0 GROUP BY subq_0.listing__country_latest diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_min_max_only_categorical__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_min_max_only_categorical__plan0_optimized.sql index d17cb70a5a..42ca29108d 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_min_max_only_categorical__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Postgres/test_min_max_only_categorical__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- ['listing__country_latest'] SELECT country AS listing__country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 GROUP BY country ) subq_3 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Redshift/test_min_max_only_categorical__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Redshift/test_min_max_only_categorical__plan0.sql index 68e8730f58..3709b8dedc 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Redshift/test_min_max_only_categorical__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Redshift/test_min_max_only_categorical__plan0.sql @@ -11,62 +11,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , CASE WHEN EXTRACT(dow FROM listings_latest_src_10004.created_at) = 0 THEN EXTRACT(dow FROM listings_latest_src_10004.created_at) + 7 ELSE EXTRACT(dow FROM listings_latest_src_10004.created_at) END AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , CASE WHEN EXTRACT(dow FROM listings_latest_src_10004.created_at) = 0 THEN EXTRACT(dow FROM listings_latest_src_10004.created_at) + 7 ELSE EXTRACT(dow FROM listings_latest_src_10004.created_at) END AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , CASE WHEN EXTRACT(dow FROM listings_latest_src_10004.created_at) = 0 THEN EXTRACT(dow FROM listings_latest_src_10004.created_at) + 7 ELSE EXTRACT(dow FROM listings_latest_src_10004.created_at) END AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , CASE WHEN EXTRACT(dow FROM listings_latest_src_10004.created_at) = 0 THEN EXTRACT(dow FROM listings_latest_src_10004.created_at) + 7 ELSE EXTRACT(dow FROM listings_latest_src_10004.created_at) END AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , CASE WHEN EXTRACT(dow FROM listings_latest_src_10005.created_at) = 0 THEN EXTRACT(dow FROM listings_latest_src_10005.created_at) + 7 ELSE EXTRACT(dow FROM listings_latest_src_10005.created_at) END AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , CASE WHEN EXTRACT(dow FROM listings_latest_src_10005.created_at) = 0 THEN EXTRACT(dow FROM listings_latest_src_10005.created_at) + 7 ELSE EXTRACT(dow FROM listings_latest_src_10005.created_at) END AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , CASE WHEN EXTRACT(dow FROM listings_latest_src_10005.created_at) = 0 THEN EXTRACT(dow FROM listings_latest_src_10005.created_at) + 7 ELSE EXTRACT(dow FROM listings_latest_src_10005.created_at) END AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , CASE WHEN EXTRACT(dow FROM listings_latest_src_10005.created_at) = 0 THEN EXTRACT(dow FROM listings_latest_src_10005.created_at) + 7 ELSE EXTRACT(dow FROM listings_latest_src_10005.created_at) END AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_0 GROUP BY subq_0.listing__country_latest diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Redshift/test_min_max_only_categorical__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Redshift/test_min_max_only_categorical__plan0_optimized.sql index d17cb70a5a..42ca29108d 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Redshift/test_min_max_only_categorical__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Redshift/test_min_max_only_categorical__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- ['listing__country_latest'] SELECT country AS listing__country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 GROUP BY country ) subq_3 diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Snowflake/test_min_max_only_categorical__plan0.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Snowflake/test_min_max_only_categorical__plan0.sql index 33508958a5..499b42eaa1 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Snowflake/test_min_max_only_categorical__plan0.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Snowflake/test_min_max_only_categorical__plan0.sql @@ -11,62 +11,62 @@ FROM ( -- Read Elements From Semantic Model 'listings_latest' SELECT 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS ds__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(dayofweekiso FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS created_at__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(dayofweekiso FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__ds__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(dayofweekiso FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy - , DATE_TRUNC('day', listings_latest_src_10004.created_at) AS listing__created_at__day - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(dayofweekiso FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 + , listings_latest_src_10005.capacity AS largest_listing + , listings_latest_src_10005.capacity AS smallest_listing + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS ds__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS ds__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS ds__extract_day + , EXTRACT(dayofweekiso FROM listings_latest_src_10005.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS created_at__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS created_at__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS created_at__extract_day + , EXTRACT(dayofweekiso FROM listings_latest_src_10005.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS created_at__extract_doy + , listings_latest_src_10005.country AS country_latest + , listings_latest_src_10005.is_lux AS is_lux_latest + , listings_latest_src_10005.capacity AS capacity_latest + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__ds__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__ds__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__ds__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__ds__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__ds__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__ds__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__ds__extract_day + , EXTRACT(dayofweekiso FROM listings_latest_src_10005.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__ds__extract_doy + , DATE_TRUNC('day', listings_latest_src_10005.created_at) AS listing__created_at__day + , DATE_TRUNC('week', listings_latest_src_10005.created_at) AS listing__created_at__week + , DATE_TRUNC('month', listings_latest_src_10005.created_at) AS listing__created_at__month + , DATE_TRUNC('quarter', listings_latest_src_10005.created_at) AS listing__created_at__quarter + , DATE_TRUNC('year', listings_latest_src_10005.created_at) AS listing__created_at__year + , EXTRACT(year FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_month + , EXTRACT(day FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_day + , EXTRACT(dayofweekiso FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10005.created_at) AS listing__created_at__extract_doy + , listings_latest_src_10005.country AS listing__country_latest + , listings_latest_src_10005.is_lux AS listing__is_lux_latest + , listings_latest_src_10005.capacity AS listing__capacity_latest + , listings_latest_src_10005.listing_id AS listing + , listings_latest_src_10005.user_id AS user + , listings_latest_src_10005.user_id AS listing__user + FROM ***************************.dim_listings_latest listings_latest_src_10005 ) subq_0 GROUP BY subq_0.listing__country_latest diff --git a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Snowflake/test_min_max_only_categorical__plan0_optimized.sql b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Snowflake/test_min_max_only_categorical__plan0_optimized.sql index d17cb70a5a..42ca29108d 100644 --- a/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Snowflake/test_min_max_only_categorical__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_query_rendering.py/SqlQueryPlan/Snowflake/test_min_max_only_categorical__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( -- ['listing__country_latest'] SELECT country AS listing__country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10004 + FROM ***************************.dim_listings_latest listings_latest_src_10005 GROUP BY country ) subq_3