From 8666f5cdf12b173c8c42d3609ec9222af6998cb2 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Thu, 11 Jul 2024 10:11:19 -0700 Subject: [PATCH] Update engine snapshots --- ...ith_0_multi_metric_query__query_output.txt | 42 ++--------- ...nulls_with_0_metric_time__query_output.txt | 42 ++--------- ...ith_0_multi_metric_query__query_output.txt | 42 ++--------- ...nulls_with_0_metric_time__query_output.txt | 42 ++--------- ...ith_0_multi_metric_query__query_output.txt | 42 ++--------- ...nulls_with_0_metric_time__query_output.txt | 42 ++--------- ...ith_0_multi_metric_query__query_output.txt | 42 ++--------- ...nulls_with_0_metric_time__query_output.txt | 42 ++--------- ...ith_0_multi_metric_query__query_output.txt | 42 ++--------- ...nulls_with_0_metric_time__query_output.txt | 42 ++--------- ...ith_0_multi_metric_query__query_output.txt | 42 ++--------- ...nulls_with_0_metric_time__query_output.txt | 42 ++--------- ...join_to_time_spine_with_filters__plan0.sql | 47 ++++++------ ...me_spine_with_filters__plan0_optimized.sql | 72 +++++++++---------- ...join_to_time_spine_with_filters__plan0.sql | 47 ++++++------ ...me_spine_with_filters__plan0_optimized.sql | 72 +++++++++---------- ...join_to_time_spine_with_filters__plan0.sql | 47 ++++++------ ...me_spine_with_filters__plan0_optimized.sql | 72 +++++++++---------- ...join_to_time_spine_with_filters__plan0.sql | 47 ++++++------ ...me_spine_with_filters__plan0_optimized.sql | 72 +++++++++---------- ...join_to_time_spine_with_filters__plan0.sql | 47 ++++++------ ...me_spine_with_filters__plan0_optimized.sql | 72 +++++++++---------- ...join_to_time_spine_with_filters__plan0.sql | 47 ++++++------ ...me_spine_with_filters__plan0_optimized.sql | 72 +++++++++---------- 24 files changed, 384 insertions(+), 834 deletions(-) diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/BigQuery/test_fill_nulls_with_0_multi_metric_query__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/BigQuery/test_fill_nulls_with_0_multi_metric_query__query_output.txt index c70bb40bf0..10e1ce0068 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/BigQuery/test_fill_nulls_with_0_multi_metric_query__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/BigQuery/test_fill_nulls_with_0_multi_metric_query__query_output.txt @@ -1,42 +1,8 @@ -metric_time__day bookings_fill_nulls_with_0 views +metric_time__week bookings_fill_nulls_with_0 views ------------------- ---------------------------- ------- -2019-11-27T00:00:00 0 None -2019-11-28T00:00:00 0 None -2019-11-29T00:00:00 0 None -2019-11-30T00:00:00 0 None -2019-12-01T00:00:00 1 None +2019-11-25T00:00:00 1 None 2019-12-02T00:00:00 0 None -2019-12-03T00:00:00 0 None -2019-12-04T00:00:00 0 None -2019-12-05T00:00:00 0 None -2019-12-06T00:00:00 0 None -2019-12-07T00:00:00 0 None -2019-12-08T00:00:00 0 None 2019-12-09T00:00:00 0 None -2019-12-10T00:00:00 0 None -2019-12-11T00:00:00 0 None -2019-12-12T00:00:00 0 None -2019-12-13T00:00:00 0 None -2019-12-14T00:00:00 0 None -2019-12-15T00:00:00 0 None -2019-12-16T00:00:00 0 None -2019-12-17T00:00:00 0 None -2019-12-18T00:00:00 10 None -2019-12-19T00:00:00 18 None -2019-12-20T00:00:00 2 None -2019-12-21T00:00:00 0 None -2019-12-22T00:00:00 0 None +2019-12-16T00:00:00 30 None 2019-12-23T00:00:00 0 None -2019-12-24T00:00:00 0 None -2019-12-25T00:00:00 0 None -2019-12-26T00:00:00 0 None -2019-12-27T00:00:00 0 None -2019-12-28T00:00:00 0 None -2019-12-29T00:00:00 0 None -2019-12-30T00:00:00 0 None -2019-12-31T00:00:00 0 None -2020-01-01T00:00:00 5 2 -2020-01-02T00:00:00 9 5 -2020-01-03T00:00:00 1 None -2020-01-04T00:00:00 0 1 -2020-01-05T00:00:00 0 1 +2019-12-30T00:00:00 15 9 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/BigQuery/test_simple_fill_nulls_with_0_metric_time__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/BigQuery/test_simple_fill_nulls_with_0_metric_time__query_output.txt index acca77988d..ae8abac1e2 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/BigQuery/test_simple_fill_nulls_with_0_metric_time__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/BigQuery/test_simple_fill_nulls_with_0_metric_time__query_output.txt @@ -1,42 +1,8 @@ -metric_time__day bookings_fill_nulls_with_0 +metric_time__week bookings_fill_nulls_with_0 ------------------- ---------------------------- -2019-11-27T00:00:00 0 -2019-11-28T00:00:00 0 -2019-11-29T00:00:00 0 -2019-11-30T00:00:00 0 -2019-12-01T00:00:00 1 +2019-11-25T00:00:00 1 2019-12-02T00:00:00 0 -2019-12-03T00:00:00 0 -2019-12-04T00:00:00 0 -2019-12-05T00:00:00 0 -2019-12-06T00:00:00 0 -2019-12-07T00:00:00 0 -2019-12-08T00:00:00 0 2019-12-09T00:00:00 0 -2019-12-10T00:00:00 0 -2019-12-11T00:00:00 0 -2019-12-12T00:00:00 0 -2019-12-13T00:00:00 0 -2019-12-14T00:00:00 0 -2019-12-15T00:00:00 0 -2019-12-16T00:00:00 0 -2019-12-17T00:00:00 0 -2019-12-18T00:00:00 10 -2019-12-19T00:00:00 18 -2019-12-20T00:00:00 2 -2019-12-21T00:00:00 0 -2019-12-22T00:00:00 0 +2019-12-16T00:00:00 30 2019-12-23T00:00:00 0 -2019-12-24T00:00:00 0 -2019-12-25T00:00:00 0 -2019-12-26T00:00:00 0 -2019-12-27T00:00:00 0 -2019-12-28T00:00:00 0 -2019-12-29T00:00:00 0 -2019-12-30T00:00:00 0 -2019-12-31T00:00:00 0 -2020-01-01T00:00:00 5 -2020-01-02T00:00:00 9 -2020-01-03T00:00:00 1 -2020-01-04T00:00:00 0 -2020-01-05T00:00:00 0 +2019-12-30T00:00:00 15 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Databricks/test_fill_nulls_with_0_multi_metric_query__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Databricks/test_fill_nulls_with_0_multi_metric_query__query_output.txt index c70bb40bf0..10e1ce0068 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Databricks/test_fill_nulls_with_0_multi_metric_query__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Databricks/test_fill_nulls_with_0_multi_metric_query__query_output.txt @@ -1,42 +1,8 @@ -metric_time__day bookings_fill_nulls_with_0 views +metric_time__week bookings_fill_nulls_with_0 views ------------------- ---------------------------- ------- -2019-11-27T00:00:00 0 None -2019-11-28T00:00:00 0 None -2019-11-29T00:00:00 0 None -2019-11-30T00:00:00 0 None -2019-12-01T00:00:00 1 None +2019-11-25T00:00:00 1 None 2019-12-02T00:00:00 0 None -2019-12-03T00:00:00 0 None -2019-12-04T00:00:00 0 None -2019-12-05T00:00:00 0 None -2019-12-06T00:00:00 0 None -2019-12-07T00:00:00 0 None -2019-12-08T00:00:00 0 None 2019-12-09T00:00:00 0 None -2019-12-10T00:00:00 0 None -2019-12-11T00:00:00 0 None -2019-12-12T00:00:00 0 None -2019-12-13T00:00:00 0 None -2019-12-14T00:00:00 0 None -2019-12-15T00:00:00 0 None -2019-12-16T00:00:00 0 None -2019-12-17T00:00:00 0 None -2019-12-18T00:00:00 10 None -2019-12-19T00:00:00 18 None -2019-12-20T00:00:00 2 None -2019-12-21T00:00:00 0 None -2019-12-22T00:00:00 0 None +2019-12-16T00:00:00 30 None 2019-12-23T00:00:00 0 None -2019-12-24T00:00:00 0 None -2019-12-25T00:00:00 0 None -2019-12-26T00:00:00 0 None -2019-12-27T00:00:00 0 None -2019-12-28T00:00:00 0 None -2019-12-29T00:00:00 0 None -2019-12-30T00:00:00 0 None -2019-12-31T00:00:00 0 None -2020-01-01T00:00:00 5 2 -2020-01-02T00:00:00 9 5 -2020-01-03T00:00:00 1 None -2020-01-04T00:00:00 0 1 -2020-01-05T00:00:00 0 1 +2019-12-30T00:00:00 15 9 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Databricks/test_simple_fill_nulls_with_0_metric_time__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Databricks/test_simple_fill_nulls_with_0_metric_time__query_output.txt index acca77988d..ae8abac1e2 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Databricks/test_simple_fill_nulls_with_0_metric_time__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Databricks/test_simple_fill_nulls_with_0_metric_time__query_output.txt @@ -1,42 +1,8 @@ -metric_time__day bookings_fill_nulls_with_0 +metric_time__week bookings_fill_nulls_with_0 ------------------- ---------------------------- -2019-11-27T00:00:00 0 -2019-11-28T00:00:00 0 -2019-11-29T00:00:00 0 -2019-11-30T00:00:00 0 -2019-12-01T00:00:00 1 +2019-11-25T00:00:00 1 2019-12-02T00:00:00 0 -2019-12-03T00:00:00 0 -2019-12-04T00:00:00 0 -2019-12-05T00:00:00 0 -2019-12-06T00:00:00 0 -2019-12-07T00:00:00 0 -2019-12-08T00:00:00 0 2019-12-09T00:00:00 0 -2019-12-10T00:00:00 0 -2019-12-11T00:00:00 0 -2019-12-12T00:00:00 0 -2019-12-13T00:00:00 0 -2019-12-14T00:00:00 0 -2019-12-15T00:00:00 0 -2019-12-16T00:00:00 0 -2019-12-17T00:00:00 0 -2019-12-18T00:00:00 10 -2019-12-19T00:00:00 18 -2019-12-20T00:00:00 2 -2019-12-21T00:00:00 0 -2019-12-22T00:00:00 0 +2019-12-16T00:00:00 30 2019-12-23T00:00:00 0 -2019-12-24T00:00:00 0 -2019-12-25T00:00:00 0 -2019-12-26T00:00:00 0 -2019-12-27T00:00:00 0 -2019-12-28T00:00:00 0 -2019-12-29T00:00:00 0 -2019-12-30T00:00:00 0 -2019-12-31T00:00:00 0 -2020-01-01T00:00:00 5 -2020-01-02T00:00:00 9 -2020-01-03T00:00:00 1 -2020-01-04T00:00:00 0 -2020-01-05T00:00:00 0 +2019-12-30T00:00:00 15 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Postgres/test_fill_nulls_with_0_multi_metric_query__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Postgres/test_fill_nulls_with_0_multi_metric_query__query_output.txt index c70bb40bf0..10e1ce0068 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Postgres/test_fill_nulls_with_0_multi_metric_query__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Postgres/test_fill_nulls_with_0_multi_metric_query__query_output.txt @@ -1,42 +1,8 @@ -metric_time__day bookings_fill_nulls_with_0 views +metric_time__week bookings_fill_nulls_with_0 views ------------------- ---------------------------- ------- -2019-11-27T00:00:00 0 None -2019-11-28T00:00:00 0 None -2019-11-29T00:00:00 0 None -2019-11-30T00:00:00 0 None -2019-12-01T00:00:00 1 None +2019-11-25T00:00:00 1 None 2019-12-02T00:00:00 0 None -2019-12-03T00:00:00 0 None -2019-12-04T00:00:00 0 None -2019-12-05T00:00:00 0 None -2019-12-06T00:00:00 0 None -2019-12-07T00:00:00 0 None -2019-12-08T00:00:00 0 None 2019-12-09T00:00:00 0 None -2019-12-10T00:00:00 0 None -2019-12-11T00:00:00 0 None -2019-12-12T00:00:00 0 None -2019-12-13T00:00:00 0 None -2019-12-14T00:00:00 0 None -2019-12-15T00:00:00 0 None -2019-12-16T00:00:00 0 None -2019-12-17T00:00:00 0 None -2019-12-18T00:00:00 10 None -2019-12-19T00:00:00 18 None -2019-12-20T00:00:00 2 None -2019-12-21T00:00:00 0 None -2019-12-22T00:00:00 0 None +2019-12-16T00:00:00 30 None 2019-12-23T00:00:00 0 None -2019-12-24T00:00:00 0 None -2019-12-25T00:00:00 0 None -2019-12-26T00:00:00 0 None -2019-12-27T00:00:00 0 None -2019-12-28T00:00:00 0 None -2019-12-29T00:00:00 0 None -2019-12-30T00:00:00 0 None -2019-12-31T00:00:00 0 None -2020-01-01T00:00:00 5 2 -2020-01-02T00:00:00 9 5 -2020-01-03T00:00:00 1 None -2020-01-04T00:00:00 0 1 -2020-01-05T00:00:00 0 1 +2019-12-30T00:00:00 15 9 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Postgres/test_simple_fill_nulls_with_0_metric_time__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Postgres/test_simple_fill_nulls_with_0_metric_time__query_output.txt index acca77988d..ae8abac1e2 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Postgres/test_simple_fill_nulls_with_0_metric_time__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Postgres/test_simple_fill_nulls_with_0_metric_time__query_output.txt @@ -1,42 +1,8 @@ -metric_time__day bookings_fill_nulls_with_0 +metric_time__week bookings_fill_nulls_with_0 ------------------- ---------------------------- -2019-11-27T00:00:00 0 -2019-11-28T00:00:00 0 -2019-11-29T00:00:00 0 -2019-11-30T00:00:00 0 -2019-12-01T00:00:00 1 +2019-11-25T00:00:00 1 2019-12-02T00:00:00 0 -2019-12-03T00:00:00 0 -2019-12-04T00:00:00 0 -2019-12-05T00:00:00 0 -2019-12-06T00:00:00 0 -2019-12-07T00:00:00 0 -2019-12-08T00:00:00 0 2019-12-09T00:00:00 0 -2019-12-10T00:00:00 0 -2019-12-11T00:00:00 0 -2019-12-12T00:00:00 0 -2019-12-13T00:00:00 0 -2019-12-14T00:00:00 0 -2019-12-15T00:00:00 0 -2019-12-16T00:00:00 0 -2019-12-17T00:00:00 0 -2019-12-18T00:00:00 10 -2019-12-19T00:00:00 18 -2019-12-20T00:00:00 2 -2019-12-21T00:00:00 0 -2019-12-22T00:00:00 0 +2019-12-16T00:00:00 30 2019-12-23T00:00:00 0 -2019-12-24T00:00:00 0 -2019-12-25T00:00:00 0 -2019-12-26T00:00:00 0 -2019-12-27T00:00:00 0 -2019-12-28T00:00:00 0 -2019-12-29T00:00:00 0 -2019-12-30T00:00:00 0 -2019-12-31T00:00:00 0 -2020-01-01T00:00:00 5 -2020-01-02T00:00:00 9 -2020-01-03T00:00:00 1 -2020-01-04T00:00:00 0 -2020-01-05T00:00:00 0 +2019-12-30T00:00:00 15 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Redshift/test_fill_nulls_with_0_multi_metric_query__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Redshift/test_fill_nulls_with_0_multi_metric_query__query_output.txt index c70bb40bf0..10e1ce0068 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Redshift/test_fill_nulls_with_0_multi_metric_query__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Redshift/test_fill_nulls_with_0_multi_metric_query__query_output.txt @@ -1,42 +1,8 @@ -metric_time__day bookings_fill_nulls_with_0 views +metric_time__week bookings_fill_nulls_with_0 views ------------------- ---------------------------- ------- -2019-11-27T00:00:00 0 None -2019-11-28T00:00:00 0 None -2019-11-29T00:00:00 0 None -2019-11-30T00:00:00 0 None -2019-12-01T00:00:00 1 None +2019-11-25T00:00:00 1 None 2019-12-02T00:00:00 0 None -2019-12-03T00:00:00 0 None -2019-12-04T00:00:00 0 None -2019-12-05T00:00:00 0 None -2019-12-06T00:00:00 0 None -2019-12-07T00:00:00 0 None -2019-12-08T00:00:00 0 None 2019-12-09T00:00:00 0 None -2019-12-10T00:00:00 0 None -2019-12-11T00:00:00 0 None -2019-12-12T00:00:00 0 None -2019-12-13T00:00:00 0 None -2019-12-14T00:00:00 0 None -2019-12-15T00:00:00 0 None -2019-12-16T00:00:00 0 None -2019-12-17T00:00:00 0 None -2019-12-18T00:00:00 10 None -2019-12-19T00:00:00 18 None -2019-12-20T00:00:00 2 None -2019-12-21T00:00:00 0 None -2019-12-22T00:00:00 0 None +2019-12-16T00:00:00 30 None 2019-12-23T00:00:00 0 None -2019-12-24T00:00:00 0 None -2019-12-25T00:00:00 0 None -2019-12-26T00:00:00 0 None -2019-12-27T00:00:00 0 None -2019-12-28T00:00:00 0 None -2019-12-29T00:00:00 0 None -2019-12-30T00:00:00 0 None -2019-12-31T00:00:00 0 None -2020-01-01T00:00:00 5 2 -2020-01-02T00:00:00 9 5 -2020-01-03T00:00:00 1 None -2020-01-04T00:00:00 0 1 -2020-01-05T00:00:00 0 1 +2019-12-30T00:00:00 15 9 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Redshift/test_simple_fill_nulls_with_0_metric_time__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Redshift/test_simple_fill_nulls_with_0_metric_time__query_output.txt index acca77988d..ae8abac1e2 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Redshift/test_simple_fill_nulls_with_0_metric_time__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Redshift/test_simple_fill_nulls_with_0_metric_time__query_output.txt @@ -1,42 +1,8 @@ -metric_time__day bookings_fill_nulls_with_0 +metric_time__week bookings_fill_nulls_with_0 ------------------- ---------------------------- -2019-11-27T00:00:00 0 -2019-11-28T00:00:00 0 -2019-11-29T00:00:00 0 -2019-11-30T00:00:00 0 -2019-12-01T00:00:00 1 +2019-11-25T00:00:00 1 2019-12-02T00:00:00 0 -2019-12-03T00:00:00 0 -2019-12-04T00:00:00 0 -2019-12-05T00:00:00 0 -2019-12-06T00:00:00 0 -2019-12-07T00:00:00 0 -2019-12-08T00:00:00 0 2019-12-09T00:00:00 0 -2019-12-10T00:00:00 0 -2019-12-11T00:00:00 0 -2019-12-12T00:00:00 0 -2019-12-13T00:00:00 0 -2019-12-14T00:00:00 0 -2019-12-15T00:00:00 0 -2019-12-16T00:00:00 0 -2019-12-17T00:00:00 0 -2019-12-18T00:00:00 10 -2019-12-19T00:00:00 18 -2019-12-20T00:00:00 2 -2019-12-21T00:00:00 0 -2019-12-22T00:00:00 0 +2019-12-16T00:00:00 30 2019-12-23T00:00:00 0 -2019-12-24T00:00:00 0 -2019-12-25T00:00:00 0 -2019-12-26T00:00:00 0 -2019-12-27T00:00:00 0 -2019-12-28T00:00:00 0 -2019-12-29T00:00:00 0 -2019-12-30T00:00:00 0 -2019-12-31T00:00:00 0 -2020-01-01T00:00:00 5 -2020-01-02T00:00:00 9 -2020-01-03T00:00:00 1 -2020-01-04T00:00:00 0 -2020-01-05T00:00:00 0 +2019-12-30T00:00:00 15 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Snowflake/test_fill_nulls_with_0_multi_metric_query__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Snowflake/test_fill_nulls_with_0_multi_metric_query__query_output.txt index 348ea40466..a21899c27d 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Snowflake/test_fill_nulls_with_0_multi_metric_query__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Snowflake/test_fill_nulls_with_0_multi_metric_query__query_output.txt @@ -1,42 +1,8 @@ -METRIC_TIME__DAY BOOKINGS_FILL_NULLS_WITH_0 VIEWS +METRIC_TIME__WEEK BOOKINGS_FILL_NULLS_WITH_0 VIEWS ------------------- ---------------------------- ------- -2019-11-27T00:00:00 0 None -2019-11-28T00:00:00 0 None -2019-11-29T00:00:00 0 None -2019-11-30T00:00:00 0 None -2019-12-01T00:00:00 1 None +2019-11-25T00:00:00 1 None 2019-12-02T00:00:00 0 None -2019-12-03T00:00:00 0 None -2019-12-04T00:00:00 0 None -2019-12-05T00:00:00 0 None -2019-12-06T00:00:00 0 None -2019-12-07T00:00:00 0 None -2019-12-08T00:00:00 0 None 2019-12-09T00:00:00 0 None -2019-12-10T00:00:00 0 None -2019-12-11T00:00:00 0 None -2019-12-12T00:00:00 0 None -2019-12-13T00:00:00 0 None -2019-12-14T00:00:00 0 None -2019-12-15T00:00:00 0 None -2019-12-16T00:00:00 0 None -2019-12-17T00:00:00 0 None -2019-12-18T00:00:00 10 None -2019-12-19T00:00:00 18 None -2019-12-20T00:00:00 2 None -2019-12-21T00:00:00 0 None -2019-12-22T00:00:00 0 None +2019-12-16T00:00:00 30 None 2019-12-23T00:00:00 0 None -2019-12-24T00:00:00 0 None -2019-12-25T00:00:00 0 None -2019-12-26T00:00:00 0 None -2019-12-27T00:00:00 0 None -2019-12-28T00:00:00 0 None -2019-12-29T00:00:00 0 None -2019-12-30T00:00:00 0 None -2019-12-31T00:00:00 0 None -2020-01-01T00:00:00 5 2 -2020-01-02T00:00:00 9 5 -2020-01-03T00:00:00 1 None -2020-01-04T00:00:00 0 1 -2020-01-05T00:00:00 0 1 +2019-12-30T00:00:00 15 9 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Snowflake/test_simple_fill_nulls_with_0_metric_time__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Snowflake/test_simple_fill_nulls_with_0_metric_time__query_output.txt index bdd65d9741..222d8c7a8d 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Snowflake/test_simple_fill_nulls_with_0_metric_time__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Snowflake/test_simple_fill_nulls_with_0_metric_time__query_output.txt @@ -1,42 +1,8 @@ -METRIC_TIME__DAY BOOKINGS_FILL_NULLS_WITH_0 +METRIC_TIME__WEEK BOOKINGS_FILL_NULLS_WITH_0 ------------------- ---------------------------- -2019-11-27T00:00:00 0 -2019-11-28T00:00:00 0 -2019-11-29T00:00:00 0 -2019-11-30T00:00:00 0 -2019-12-01T00:00:00 1 +2019-11-25T00:00:00 1 2019-12-02T00:00:00 0 -2019-12-03T00:00:00 0 -2019-12-04T00:00:00 0 -2019-12-05T00:00:00 0 -2019-12-06T00:00:00 0 -2019-12-07T00:00:00 0 -2019-12-08T00:00:00 0 2019-12-09T00:00:00 0 -2019-12-10T00:00:00 0 -2019-12-11T00:00:00 0 -2019-12-12T00:00:00 0 -2019-12-13T00:00:00 0 -2019-12-14T00:00:00 0 -2019-12-15T00:00:00 0 -2019-12-16T00:00:00 0 -2019-12-17T00:00:00 0 -2019-12-18T00:00:00 10 -2019-12-19T00:00:00 18 -2019-12-20T00:00:00 2 -2019-12-21T00:00:00 0 -2019-12-22T00:00:00 0 +2019-12-16T00:00:00 30 2019-12-23T00:00:00 0 -2019-12-24T00:00:00 0 -2019-12-25T00:00:00 0 -2019-12-26T00:00:00 0 -2019-12-27T00:00:00 0 -2019-12-28T00:00:00 0 -2019-12-29T00:00:00 0 -2019-12-30T00:00:00 0 -2019-12-31T00:00:00 0 -2020-01-01T00:00:00 5 -2020-01-02T00:00:00 9 -2020-01-03T00:00:00 1 -2020-01-04T00:00:00 0 -2020-01-05T00:00:00 0 +2019-12-30T00:00:00 15 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Trino/test_fill_nulls_with_0_multi_metric_query__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Trino/test_fill_nulls_with_0_multi_metric_query__query_output.txt index c70bb40bf0..10e1ce0068 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Trino/test_fill_nulls_with_0_multi_metric_query__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Trino/test_fill_nulls_with_0_multi_metric_query__query_output.txt @@ -1,42 +1,8 @@ -metric_time__day bookings_fill_nulls_with_0 views +metric_time__week bookings_fill_nulls_with_0 views ------------------- ---------------------------- ------- -2019-11-27T00:00:00 0 None -2019-11-28T00:00:00 0 None -2019-11-29T00:00:00 0 None -2019-11-30T00:00:00 0 None -2019-12-01T00:00:00 1 None +2019-11-25T00:00:00 1 None 2019-12-02T00:00:00 0 None -2019-12-03T00:00:00 0 None -2019-12-04T00:00:00 0 None -2019-12-05T00:00:00 0 None -2019-12-06T00:00:00 0 None -2019-12-07T00:00:00 0 None -2019-12-08T00:00:00 0 None 2019-12-09T00:00:00 0 None -2019-12-10T00:00:00 0 None -2019-12-11T00:00:00 0 None -2019-12-12T00:00:00 0 None -2019-12-13T00:00:00 0 None -2019-12-14T00:00:00 0 None -2019-12-15T00:00:00 0 None -2019-12-16T00:00:00 0 None -2019-12-17T00:00:00 0 None -2019-12-18T00:00:00 10 None -2019-12-19T00:00:00 18 None -2019-12-20T00:00:00 2 None -2019-12-21T00:00:00 0 None -2019-12-22T00:00:00 0 None +2019-12-16T00:00:00 30 None 2019-12-23T00:00:00 0 None -2019-12-24T00:00:00 0 None -2019-12-25T00:00:00 0 None -2019-12-26T00:00:00 0 None -2019-12-27T00:00:00 0 None -2019-12-28T00:00:00 0 None -2019-12-29T00:00:00 0 None -2019-12-30T00:00:00 0 None -2019-12-31T00:00:00 0 None -2020-01-01T00:00:00 5 2 -2020-01-02T00:00:00 9 5 -2020-01-03T00:00:00 1 None -2020-01-04T00:00:00 0 1 -2020-01-05T00:00:00 0 1 +2019-12-30T00:00:00 15 9 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Trino/test_simple_fill_nulls_with_0_metric_time__query_output.txt b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Trino/test_simple_fill_nulls_with_0_metric_time__query_output.txt index acca77988d..ae8abac1e2 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Trino/test_simple_fill_nulls_with_0_metric_time__query_output.txt +++ b/tests_metricflow/snapshots/test_fill_nulls_with_0.py/str/Trino/test_simple_fill_nulls_with_0_metric_time__query_output.txt @@ -1,42 +1,8 @@ -metric_time__day bookings_fill_nulls_with_0 +metric_time__week bookings_fill_nulls_with_0 ------------------- ---------------------------- -2019-11-27T00:00:00 0 -2019-11-28T00:00:00 0 -2019-11-29T00:00:00 0 -2019-11-30T00:00:00 0 -2019-12-01T00:00:00 1 +2019-11-25T00:00:00 1 2019-12-02T00:00:00 0 -2019-12-03T00:00:00 0 -2019-12-04T00:00:00 0 -2019-12-05T00:00:00 0 -2019-12-06T00:00:00 0 -2019-12-07T00:00:00 0 -2019-12-08T00:00:00 0 2019-12-09T00:00:00 0 -2019-12-10T00:00:00 0 -2019-12-11T00:00:00 0 -2019-12-12T00:00:00 0 -2019-12-13T00:00:00 0 -2019-12-14T00:00:00 0 -2019-12-15T00:00:00 0 -2019-12-16T00:00:00 0 -2019-12-17T00:00:00 0 -2019-12-18T00:00:00 10 -2019-12-19T00:00:00 18 -2019-12-20T00:00:00 2 -2019-12-21T00:00:00 0 -2019-12-22T00:00:00 0 +2019-12-16T00:00:00 30 2019-12-23T00:00:00 0 -2019-12-24T00:00:00 0 -2019-12-25T00:00:00 0 -2019-12-26T00:00:00 0 -2019-12-27T00:00:00 0 -2019-12-28T00:00:00 0 -2019-12-29T00:00:00 0 -2019-12-30T00:00:00 0 -2019-12-31T00:00:00 0 -2020-01-01T00:00:00 5 -2020-01-02T00:00:00 9 -2020-01-03T00:00:00 1 -2020-01-04T00:00:00 0 -2020-01-05T00:00:00 0 +2019-12-30T00:00:00 15 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filters__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filters__plan0.sql index 4a7eb2a2b0..67725fef7f 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filters__plan0.sql @@ -8,36 +8,38 @@ FROM ( subq_9.metric_time__day , subq_9.bookings FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day - , subq_8.bookings + subq_7.metric_time__day AS metric_time__day + , subq_6.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_6.metric_time__day AS metric_time__day - , subq_5.bookings AS bookings + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + WHERE subq_8.ds BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_7 + LEFT OUTER JOIN ( + -- Aggregate Measures + SELECT + subq_5.metric_time__day + , SUM(subq_5.bookings) AS bookings FROM ( - -- Time Spine - SELECT - subq_7.ds AS metric_time__day - FROM ***************************.mf_time_spine subq_7 - WHERE subq_7.ds BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_6 - LEFT OUTER JOIN ( - -- Aggregate Measures + -- Pass Only Elements: ['bookings', 'metric_time__day'] SELECT subq_4.metric_time__day - , SUM(subq_4.bookings) AS bookings + , subq_4.bookings FROM ( -- Constrain Output with WHERE SELECT subq_3.metric_time__day + , subq_3.metric_time__week , subq_3.bookings FROM ( - -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT subq_2.metric_time__day + , subq_2.metric_time__week , subq_2.bookings FROM ( -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] @@ -338,15 +340,14 @@ FROM ( WHERE subq_1.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_2 ) subq_3 - WHERE metric_time__day > '2020-01-01' + WHERE metric_time__week > '2020-01-01' ) subq_4 - GROUP BY - metric_time__day ) subq_5 - ON - subq_6.metric_time__day = subq_5.metric_time__day - ) subq_8 - WHERE metric_time__day > '2020-01-01' + GROUP BY + metric_time__day + ) subq_6 + ON + subq_7.metric_time__day = subq_6.metric_time__day ) subq_9 WHERE subq_9.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_10 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filters__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filters__plan0_optimized.sql index aab114c3ea..bc2408e75b 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filters__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filters__plan0_optimized.sql @@ -3,50 +3,42 @@ SELECT metric_time__day , COALESCE(bookings, 0) AS bookings_fill_nulls_with_0 FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] SELECT - metric_time__day - , bookings + subq_18.metric_time__day AS metric_time__day + , subq_17.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_17.metric_time__day AS metric_time__day - , subq_16.bookings AS bookings + ds AS metric_time__day + FROM ***************************.mf_time_spine subq_19 + WHERE ds BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_18 + LEFT OUTER JOIN ( + -- Constrain Output with WHERE + -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Aggregate Measures + SELECT + metric_time__day + , SUM(bookings) AS bookings FROM ( - -- Time Spine - SELECT - ds AS metric_time__day - FROM ***************************.mf_time_spine subq_18 - WHERE ds BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_17 - LEFT OUTER JOIN ( - -- Constrain Output with WHERE - -- Aggregate Measures + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT - metric_time__day - , SUM(bookings) AS bookings - FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] - -- Pass Only Elements: ['bookings', 'metric_time__day'] - SELECT - DATETIME_TRUNC(ds, day) AS metric_time__day - , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_28000 - WHERE DATETIME_TRUNC(ds, day) BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_14 - WHERE metric_time__day > '2020-01-01' - GROUP BY - metric_time__day - ) subq_16 - ON - subq_17.metric_time__day = subq_16.metric_time__day - ) subq_19 - WHERE ( - metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' - ) AND ( - metric_time__day > '2020-01-01' - ) + DATETIME_TRUNC(ds, day) AS metric_time__day + , DATETIME_TRUNC(ds, isoweek) AS metric_time__week + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_28000 + WHERE DATETIME_TRUNC(ds, day) BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_14 + WHERE metric_time__week > '2020-01-01' + GROUP BY + metric_time__day + ) subq_17 + ON + subq_18.metric_time__day = subq_17.metric_time__day + WHERE subq_18.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_21 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filters__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filters__plan0.sql index c0c6005913..280c817e10 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filters__plan0.sql @@ -8,36 +8,38 @@ FROM ( subq_9.metric_time__day , subq_9.bookings FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day - , subq_8.bookings + subq_7.metric_time__day AS metric_time__day + , subq_6.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_6.metric_time__day AS metric_time__day - , subq_5.bookings AS bookings + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + WHERE subq_8.ds BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_7 + LEFT OUTER JOIN ( + -- Aggregate Measures + SELECT + subq_5.metric_time__day + , SUM(subq_5.bookings) AS bookings FROM ( - -- Time Spine - SELECT - subq_7.ds AS metric_time__day - FROM ***************************.mf_time_spine subq_7 - WHERE subq_7.ds BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_6 - LEFT OUTER JOIN ( - -- Aggregate Measures + -- Pass Only Elements: ['bookings', 'metric_time__day'] SELECT subq_4.metric_time__day - , SUM(subq_4.bookings) AS bookings + , subq_4.bookings FROM ( -- Constrain Output with WHERE SELECT subq_3.metric_time__day + , subq_3.metric_time__week , subq_3.bookings FROM ( - -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT subq_2.metric_time__day + , subq_2.metric_time__week , subq_2.bookings FROM ( -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] @@ -338,15 +340,14 @@ FROM ( WHERE subq_1.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_2 ) subq_3 - WHERE metric_time__day > '2020-01-01' + WHERE metric_time__week > '2020-01-01' ) subq_4 - GROUP BY - subq_4.metric_time__day ) subq_5 - ON - subq_6.metric_time__day = subq_5.metric_time__day - ) subq_8 - WHERE metric_time__day > '2020-01-01' + GROUP BY + subq_5.metric_time__day + ) subq_6 + ON + subq_7.metric_time__day = subq_6.metric_time__day ) subq_9 WHERE subq_9.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_10 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filters__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filters__plan0_optimized.sql index db846ac1b4..ae0e42a39e 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filters__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filters__plan0_optimized.sql @@ -3,50 +3,42 @@ SELECT metric_time__day , COALESCE(bookings, 0) AS bookings_fill_nulls_with_0 FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] SELECT - metric_time__day - , bookings + subq_18.metric_time__day AS metric_time__day + , subq_17.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_17.metric_time__day AS metric_time__day - , subq_16.bookings AS bookings + ds AS metric_time__day + FROM ***************************.mf_time_spine subq_19 + WHERE ds BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_18 + LEFT OUTER JOIN ( + -- Constrain Output with WHERE + -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Aggregate Measures + SELECT + metric_time__day + , SUM(bookings) AS bookings FROM ( - -- Time Spine - SELECT - ds AS metric_time__day - FROM ***************************.mf_time_spine subq_18 - WHERE ds BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_17 - LEFT OUTER JOIN ( - -- Constrain Output with WHERE - -- Aggregate Measures + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT - metric_time__day - , SUM(bookings) AS bookings - FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] - -- Pass Only Elements: ['bookings', 'metric_time__day'] - SELECT - DATE_TRUNC('day', ds) AS metric_time__day - , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_28000 - WHERE DATE_TRUNC('day', ds) BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_14 - WHERE metric_time__day > '2020-01-01' - GROUP BY - metric_time__day - ) subq_16 - ON - subq_17.metric_time__day = subq_16.metric_time__day - ) subq_19 - WHERE ( - metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' - ) AND ( - metric_time__day > '2020-01-01' - ) + DATE_TRUNC('day', ds) AS metric_time__day + , DATE_TRUNC('week', ds) AS metric_time__week + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_28000 + WHERE DATE_TRUNC('day', ds) BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_14 + WHERE metric_time__week > '2020-01-01' + GROUP BY + metric_time__day + ) subq_17 + ON + subq_18.metric_time__day = subq_17.metric_time__day + WHERE subq_18.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_21 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filters__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filters__plan0.sql index 37494c04d8..007e38a03c 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filters__plan0.sql @@ -8,36 +8,38 @@ FROM ( subq_9.metric_time__day , subq_9.bookings FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day - , subq_8.bookings + subq_7.metric_time__day AS metric_time__day + , subq_6.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_6.metric_time__day AS metric_time__day - , subq_5.bookings AS bookings + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + WHERE subq_8.ds BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_7 + LEFT OUTER JOIN ( + -- Aggregate Measures + SELECT + subq_5.metric_time__day + , SUM(subq_5.bookings) AS bookings FROM ( - -- Time Spine - SELECT - subq_7.ds AS metric_time__day - FROM ***************************.mf_time_spine subq_7 - WHERE subq_7.ds BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_6 - LEFT OUTER JOIN ( - -- Aggregate Measures + -- Pass Only Elements: ['bookings', 'metric_time__day'] SELECT subq_4.metric_time__day - , SUM(subq_4.bookings) AS bookings + , subq_4.bookings FROM ( -- Constrain Output with WHERE SELECT subq_3.metric_time__day + , subq_3.metric_time__week , subq_3.bookings FROM ( - -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT subq_2.metric_time__day + , subq_2.metric_time__week , subq_2.bookings FROM ( -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] @@ -338,15 +340,14 @@ FROM ( WHERE subq_1.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_2 ) subq_3 - WHERE metric_time__day > '2020-01-01' + WHERE metric_time__week > '2020-01-01' ) subq_4 - GROUP BY - subq_4.metric_time__day ) subq_5 - ON - subq_6.metric_time__day = subq_5.metric_time__day - ) subq_8 - WHERE metric_time__day > '2020-01-01' + GROUP BY + subq_5.metric_time__day + ) subq_6 + ON + subq_7.metric_time__day = subq_6.metric_time__day ) subq_9 WHERE subq_9.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_10 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filters__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filters__plan0_optimized.sql index db846ac1b4..ae0e42a39e 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filters__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filters__plan0_optimized.sql @@ -3,50 +3,42 @@ SELECT metric_time__day , COALESCE(bookings, 0) AS bookings_fill_nulls_with_0 FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] SELECT - metric_time__day - , bookings + subq_18.metric_time__day AS metric_time__day + , subq_17.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_17.metric_time__day AS metric_time__day - , subq_16.bookings AS bookings + ds AS metric_time__day + FROM ***************************.mf_time_spine subq_19 + WHERE ds BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_18 + LEFT OUTER JOIN ( + -- Constrain Output with WHERE + -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Aggregate Measures + SELECT + metric_time__day + , SUM(bookings) AS bookings FROM ( - -- Time Spine - SELECT - ds AS metric_time__day - FROM ***************************.mf_time_spine subq_18 - WHERE ds BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_17 - LEFT OUTER JOIN ( - -- Constrain Output with WHERE - -- Aggregate Measures + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT - metric_time__day - , SUM(bookings) AS bookings - FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] - -- Pass Only Elements: ['bookings', 'metric_time__day'] - SELECT - DATE_TRUNC('day', ds) AS metric_time__day - , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_28000 - WHERE DATE_TRUNC('day', ds) BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_14 - WHERE metric_time__day > '2020-01-01' - GROUP BY - metric_time__day - ) subq_16 - ON - subq_17.metric_time__day = subq_16.metric_time__day - ) subq_19 - WHERE ( - metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' - ) AND ( - metric_time__day > '2020-01-01' - ) + DATE_TRUNC('day', ds) AS metric_time__day + , DATE_TRUNC('week', ds) AS metric_time__week + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_28000 + WHERE DATE_TRUNC('day', ds) BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_14 + WHERE metric_time__week > '2020-01-01' + GROUP BY + metric_time__day + ) subq_17 + ON + subq_18.metric_time__day = subq_17.metric_time__day + WHERE subq_18.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_21 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filters__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filters__plan0.sql index cf33f1752c..fa6e5a96cd 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filters__plan0.sql @@ -8,36 +8,38 @@ FROM ( subq_9.metric_time__day , subq_9.bookings FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day - , subq_8.bookings + subq_7.metric_time__day AS metric_time__day + , subq_6.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_6.metric_time__day AS metric_time__day - , subq_5.bookings AS bookings + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + WHERE subq_8.ds BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_7 + LEFT OUTER JOIN ( + -- Aggregate Measures + SELECT + subq_5.metric_time__day + , SUM(subq_5.bookings) AS bookings FROM ( - -- Time Spine - SELECT - subq_7.ds AS metric_time__day - FROM ***************************.mf_time_spine subq_7 - WHERE subq_7.ds BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_6 - LEFT OUTER JOIN ( - -- Aggregate Measures + -- Pass Only Elements: ['bookings', 'metric_time__day'] SELECT subq_4.metric_time__day - , SUM(subq_4.bookings) AS bookings + , subq_4.bookings FROM ( -- Constrain Output with WHERE SELECT subq_3.metric_time__day + , subq_3.metric_time__week , subq_3.bookings FROM ( - -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT subq_2.metric_time__day + , subq_2.metric_time__week , subq_2.bookings FROM ( -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] @@ -338,15 +340,14 @@ FROM ( WHERE subq_1.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_2 ) subq_3 - WHERE metric_time__day > '2020-01-01' + WHERE metric_time__week > '2020-01-01' ) subq_4 - GROUP BY - subq_4.metric_time__day ) subq_5 - ON - subq_6.metric_time__day = subq_5.metric_time__day - ) subq_8 - WHERE metric_time__day > '2020-01-01' + GROUP BY + subq_5.metric_time__day + ) subq_6 + ON + subq_7.metric_time__day = subq_6.metric_time__day ) subq_9 WHERE subq_9.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_10 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filters__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filters__plan0_optimized.sql index db846ac1b4..ae0e42a39e 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filters__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filters__plan0_optimized.sql @@ -3,50 +3,42 @@ SELECT metric_time__day , COALESCE(bookings, 0) AS bookings_fill_nulls_with_0 FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] SELECT - metric_time__day - , bookings + subq_18.metric_time__day AS metric_time__day + , subq_17.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_17.metric_time__day AS metric_time__day - , subq_16.bookings AS bookings + ds AS metric_time__day + FROM ***************************.mf_time_spine subq_19 + WHERE ds BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_18 + LEFT OUTER JOIN ( + -- Constrain Output with WHERE + -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Aggregate Measures + SELECT + metric_time__day + , SUM(bookings) AS bookings FROM ( - -- Time Spine - SELECT - ds AS metric_time__day - FROM ***************************.mf_time_spine subq_18 - WHERE ds BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_17 - LEFT OUTER JOIN ( - -- Constrain Output with WHERE - -- Aggregate Measures + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT - metric_time__day - , SUM(bookings) AS bookings - FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] - -- Pass Only Elements: ['bookings', 'metric_time__day'] - SELECT - DATE_TRUNC('day', ds) AS metric_time__day - , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_28000 - WHERE DATE_TRUNC('day', ds) BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_14 - WHERE metric_time__day > '2020-01-01' - GROUP BY - metric_time__day - ) subq_16 - ON - subq_17.metric_time__day = subq_16.metric_time__day - ) subq_19 - WHERE ( - metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' - ) AND ( - metric_time__day > '2020-01-01' - ) + DATE_TRUNC('day', ds) AS metric_time__day + , DATE_TRUNC('week', ds) AS metric_time__week + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_28000 + WHERE DATE_TRUNC('day', ds) BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_14 + WHERE metric_time__week > '2020-01-01' + GROUP BY + metric_time__day + ) subq_17 + ON + subq_18.metric_time__day = subq_17.metric_time__day + WHERE subq_18.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_21 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filters__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filters__plan0.sql index 457e76d661..31df3a2c8d 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filters__plan0.sql @@ -8,36 +8,38 @@ FROM ( subq_9.metric_time__day , subq_9.bookings FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day - , subq_8.bookings + subq_7.metric_time__day AS metric_time__day + , subq_6.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_6.metric_time__day AS metric_time__day - , subq_5.bookings AS bookings + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + WHERE subq_8.ds BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_7 + LEFT OUTER JOIN ( + -- Aggregate Measures + SELECT + subq_5.metric_time__day + , SUM(subq_5.bookings) AS bookings FROM ( - -- Time Spine - SELECT - subq_7.ds AS metric_time__day - FROM ***************************.mf_time_spine subq_7 - WHERE subq_7.ds BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_6 - LEFT OUTER JOIN ( - -- Aggregate Measures + -- Pass Only Elements: ['bookings', 'metric_time__day'] SELECT subq_4.metric_time__day - , SUM(subq_4.bookings) AS bookings + , subq_4.bookings FROM ( -- Constrain Output with WHERE SELECT subq_3.metric_time__day + , subq_3.metric_time__week , subq_3.bookings FROM ( - -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT subq_2.metric_time__day + , subq_2.metric_time__week , subq_2.bookings FROM ( -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] @@ -338,15 +340,14 @@ FROM ( WHERE subq_1.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_2 ) subq_3 - WHERE metric_time__day > '2020-01-01' + WHERE metric_time__week > '2020-01-01' ) subq_4 - GROUP BY - subq_4.metric_time__day ) subq_5 - ON - subq_6.metric_time__day = subq_5.metric_time__day - ) subq_8 - WHERE metric_time__day > '2020-01-01' + GROUP BY + subq_5.metric_time__day + ) subq_6 + ON + subq_7.metric_time__day = subq_6.metric_time__day ) subq_9 WHERE subq_9.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_10 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filters__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filters__plan0_optimized.sql index db846ac1b4..ae0e42a39e 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filters__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filters__plan0_optimized.sql @@ -3,50 +3,42 @@ SELECT metric_time__day , COALESCE(bookings, 0) AS bookings_fill_nulls_with_0 FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] SELECT - metric_time__day - , bookings + subq_18.metric_time__day AS metric_time__day + , subq_17.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_17.metric_time__day AS metric_time__day - , subq_16.bookings AS bookings + ds AS metric_time__day + FROM ***************************.mf_time_spine subq_19 + WHERE ds BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_18 + LEFT OUTER JOIN ( + -- Constrain Output with WHERE + -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Aggregate Measures + SELECT + metric_time__day + , SUM(bookings) AS bookings FROM ( - -- Time Spine - SELECT - ds AS metric_time__day - FROM ***************************.mf_time_spine subq_18 - WHERE ds BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_17 - LEFT OUTER JOIN ( - -- Constrain Output with WHERE - -- Aggregate Measures + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT - metric_time__day - , SUM(bookings) AS bookings - FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] - -- Pass Only Elements: ['bookings', 'metric_time__day'] - SELECT - DATE_TRUNC('day', ds) AS metric_time__day - , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_28000 - WHERE DATE_TRUNC('day', ds) BETWEEN '2020-01-03' AND '2020-01-05' - ) subq_14 - WHERE metric_time__day > '2020-01-01' - GROUP BY - metric_time__day - ) subq_16 - ON - subq_17.metric_time__day = subq_16.metric_time__day - ) subq_19 - WHERE ( - metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' - ) AND ( - metric_time__day > '2020-01-01' - ) + DATE_TRUNC('day', ds) AS metric_time__day + , DATE_TRUNC('week', ds) AS metric_time__week + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_28000 + WHERE DATE_TRUNC('day', ds) BETWEEN '2020-01-03' AND '2020-01-05' + ) subq_14 + WHERE metric_time__week > '2020-01-01' + GROUP BY + metric_time__day + ) subq_17 + ON + subq_18.metric_time__day = subq_17.metric_time__day + WHERE subq_18.metric_time__day BETWEEN '2020-01-03' AND '2020-01-05' ) subq_21 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filters__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filters__plan0.sql index 5eb76738a5..886415bad4 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filters__plan0.sql @@ -8,36 +8,38 @@ FROM ( subq_9.metric_time__day , subq_9.bookings FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day - , subq_8.bookings + subq_7.metric_time__day AS metric_time__day + , subq_6.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_6.metric_time__day AS metric_time__day - , subq_5.bookings AS bookings + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + WHERE subq_8.ds BETWEEN timestamp '2020-01-03' AND timestamp '2020-01-05' + ) subq_7 + LEFT OUTER JOIN ( + -- Aggregate Measures + SELECT + subq_5.metric_time__day + , SUM(subq_5.bookings) AS bookings FROM ( - -- Time Spine - SELECT - subq_7.ds AS metric_time__day - FROM ***************************.mf_time_spine subq_7 - WHERE subq_7.ds BETWEEN timestamp '2020-01-03' AND timestamp '2020-01-05' - ) subq_6 - LEFT OUTER JOIN ( - -- Aggregate Measures + -- Pass Only Elements: ['bookings', 'metric_time__day'] SELECT subq_4.metric_time__day - , SUM(subq_4.bookings) AS bookings + , subq_4.bookings FROM ( -- Constrain Output with WHERE SELECT subq_3.metric_time__day + , subq_3.metric_time__week , subq_3.bookings FROM ( - -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT subq_2.metric_time__day + , subq_2.metric_time__week , subq_2.bookings FROM ( -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] @@ -338,15 +340,14 @@ FROM ( WHERE subq_1.metric_time__day BETWEEN timestamp '2020-01-03' AND timestamp '2020-01-05' ) subq_2 ) subq_3 - WHERE metric_time__day > '2020-01-01' + WHERE metric_time__week > '2020-01-01' ) subq_4 - GROUP BY - subq_4.metric_time__day ) subq_5 - ON - subq_6.metric_time__day = subq_5.metric_time__day - ) subq_8 - WHERE metric_time__day > '2020-01-01' + GROUP BY + subq_5.metric_time__day + ) subq_6 + ON + subq_7.metric_time__day = subq_6.metric_time__day ) subq_9 WHERE subq_9.metric_time__day BETWEEN timestamp '2020-01-03' AND timestamp '2020-01-05' ) subq_10 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filters__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filters__plan0_optimized.sql index 32ec18030f..e2374068e9 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filters__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filters__plan0_optimized.sql @@ -3,50 +3,42 @@ SELECT metric_time__day , COALESCE(bookings, 0) AS bookings_fill_nulls_with_0 FROM ( - -- Constrain Output with WHERE + -- Join to Time Spine Dataset -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] SELECT - metric_time__day - , bookings + subq_18.metric_time__day AS metric_time__day + , subq_17.bookings AS bookings FROM ( - -- Join to Time Spine Dataset + -- Time Spine SELECT - subq_17.metric_time__day AS metric_time__day - , subq_16.bookings AS bookings + ds AS metric_time__day + FROM ***************************.mf_time_spine subq_19 + WHERE ds BETWEEN timestamp '2020-01-03' AND timestamp '2020-01-05' + ) subq_18 + LEFT OUTER JOIN ( + -- Constrain Output with WHERE + -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Aggregate Measures + SELECT + metric_time__day + , SUM(bookings) AS bookings FROM ( - -- Time Spine - SELECT - ds AS metric_time__day - FROM ***************************.mf_time_spine subq_18 - WHERE ds BETWEEN timestamp '2020-01-03' AND timestamp '2020-01-05' - ) subq_17 - LEFT OUTER JOIN ( - -- Constrain Output with WHERE - -- Aggregate Measures + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] + -- Pass Only Elements: ['bookings', 'metric_time__day', 'metric_time__week'] SELECT - metric_time__day - , SUM(bookings) AS bookings - FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] - -- Pass Only Elements: ['bookings', 'metric_time__day'] - SELECT - DATE_TRUNC('day', ds) AS metric_time__day - , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_28000 - WHERE DATE_TRUNC('day', ds) BETWEEN timestamp '2020-01-03' AND timestamp '2020-01-05' - ) subq_14 - WHERE metric_time__day > '2020-01-01' - GROUP BY - metric_time__day - ) subq_16 - ON - subq_17.metric_time__day = subq_16.metric_time__day - ) subq_19 - WHERE ( - metric_time__day BETWEEN timestamp '2020-01-03' AND timestamp '2020-01-05' - ) AND ( - metric_time__day > '2020-01-01' - ) + DATE_TRUNC('day', ds) AS metric_time__day + , DATE_TRUNC('week', ds) AS metric_time__week + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_28000 + WHERE DATE_TRUNC('day', ds) BETWEEN timestamp '2020-01-03' AND timestamp '2020-01-05' + ) subq_14 + WHERE metric_time__week > '2020-01-01' + GROUP BY + metric_time__day + ) subq_17 + ON + subq_18.metric_time__day = subq_17.metric_time__day + WHERE subq_18.metric_time__day BETWEEN timestamp '2020-01-03' AND timestamp '2020-01-05' ) subq_21