diff --git a/metricflow/test/snapshots/test_data_warehouse_tasks.py/data_warehouse_validation_model/SqliteSqlClient/test_build_metric_tasks__query0.sql b/metricflow/test/snapshots/test_data_warehouse_tasks.py/data_warehouse_validation_model/SqliteSqlClient/test_build_metric_tasks__query0.sql deleted file mode 100644 index 97ecd59644..0000000000 --- a/metricflow/test/snapshots/test_data_warehouse_tasks.py/data_warehouse_validation_model/SqliteSqlClient/test_build_metric_tasks__query0.sql +++ /dev/null @@ -1,25 +0,0 @@ --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(count_dogs) AS count_dogs - , metric_time -FROM ( - -- Read Elements From Data Source 'animals' - -- Metric Time Dimension 'ds' - -- Constrain Time Range to [2000-01-01T00:00:00, 2040-12-31T00:00:00] - -- Pass Only Elements: - -- ['count_dogs', 'metric_time'] - SELECT - 1 AS count_dogs - , ds AS metric_time - FROM ( - SELECT * FROM ***************************.fct_animals - ) animals_src_0 - WHERE ( - ds >= CAST('2000-01-01' AS TEXT) - ) AND ( - ds <= CAST('2040-12-31' AS TEXT) - ) -) subq_3 -GROUP BY - metric_time diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_combined_metrics_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_combined_metrics_plan__ep_0.xml deleted file mode 100644 index 2e312e4d3d..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_combined_metrics_plan__ep_0.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_joined_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_joined_plan__ep_0.xml deleted file mode 100644 index b65665a22f..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_joined_plan__ep_0.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_multihop_joined_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_multihop_joined_plan__ep_0.xml deleted file mode 100644 index 60f386f319..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_multihop_joined_plan__ep_0.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_small_combined_metrics_plan__ep_0.xml b/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_small_combined_metrics_plan__ep_0.xml deleted file mode 100644 index 20f4d86bfb..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_execution.py/ExecutionPlan/SqliteSqlClient/test_small_combined_metrics_plan__ep_0.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_constrain_primary_time_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_constrain_primary_time_dimension__plan0.sql deleted file mode 100644 index 6cb5a52cbe..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_constrain_primary_time_dimension__plan0.sql +++ /dev/null @@ -1,60 +0,0 @@ --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - subq_1.bookings - , subq_1.ds -FROM ( - -- Pass Only Elements: - -- ['bookings', 'ds'] - SELECT - subq_0.bookings - , subq_0.ds - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , DATE_TRUNC(bookings_source_src_10000.ds, isoweek) AS ds__week - , DATE_TRUNC(bookings_source_src_10000.ds, month) AS ds__month - , DATE_TRUNC(bookings_source_src_10000.ds, quarter) AS ds__quarter - , DATE_TRUNC(bookings_source_src_10000.ds, isoyear) AS ds__year - , bookings_source_src_10000.ds_partitioned - , DATE_TRUNC(bookings_source_src_10000.ds_partitioned, isoweek) AS ds_partitioned__week - , DATE_TRUNC(bookings_source_src_10000.ds_partitioned, month) AS ds_partitioned__month - , DATE_TRUNC(bookings_source_src_10000.ds_partitioned, quarter) AS ds_partitioned__quarter - , DATE_TRUNC(bookings_source_src_10000.ds_partitioned, isoyear) AS ds_partitioned__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , DATE_TRUNC(bookings_source_src_10000.ds, isoweek) AS create_a_cycle_in_the_join_graph__ds__week - , DATE_TRUNC(bookings_source_src_10000.ds, month) AS create_a_cycle_in_the_join_graph__ds__month - , DATE_TRUNC(bookings_source_src_10000.ds, quarter) AS create_a_cycle_in_the_join_graph__ds__quarter - , DATE_TRUNC(bookings_source_src_10000.ds, isoyear) AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , DATE_TRUNC(bookings_source_src_10000.ds_partitioned, isoweek) AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , DATE_TRUNC(bookings_source_src_10000.ds_partitioned, month) AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , DATE_TRUNC(bookings_source_src_10000.ds_partitioned, quarter) AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , DATE_TRUNC(bookings_source_src_10000.ds_partitioned, isoyear) AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 -) subq_1 -WHERE ( - subq_1.ds >= CAST('2020-01-01' AS DATETIME) -) AND ( - subq_1.ds <= CAST('2020-01-02' AS DATETIME) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql deleted file mode 100644 index a68f92b333..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql +++ /dev/null @@ -1,16 +0,0 @@ --- Read Elements From Data Source 'bookings_source' --- Pass Only Elements: --- ['bookings', 'ds'] --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - 1 AS bookings - , ds -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 -WHERE ( - ds >= CAST('2020-01-01' AS DATETIME) -) AND ( - ds <= CAST('2020-01-02' AS DATETIME) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_local_dimension_using_local_identifier__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_local_dimension_using_local_identifier__plan0.sql deleted file mode 100644 index 30fbd12339..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_local_dimension_using_local_identifier__plan0.sql +++ /dev/null @@ -1,97 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_3.listing__country_latest - , subq_3.listings -FROM ( - -- Aggregate Measures - SELECT - subq_2.listing__country_latest - , SUM(subq_2.listings) AS listings - FROM ( - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - subq_1.listing__country_latest - , subq_1.listings - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.created_at - , subq_0.created_at__week - , subq_0.created_at__month - , subq_0.created_at__quarter - , subq_0.created_at__year - , subq_0.listing__ds - , subq_0.listing__ds__week - , subq_0.listing__ds__month - , subq_0.listing__ds__quarter - , subq_0.listing__ds__year - , subq_0.listing__created_at - , subq_0.listing__created_at__week - , subq_0.listing__created_at__month - , subq_0.listing__created_at__quarter - , subq_0.listing__created_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.user - , subq_0.listing__user - , subq_0.country_latest - , subq_0.is_lux_latest - , subq_0.capacity_latest - , subq_0.listing__country_latest - , subq_0.listing__is_lux_latest - , subq_0.listing__capacity_latest - , subq_0.listings - , subq_0.largest_listing - , subq_0.smallest_listing - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC(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, isoyear) AS ds__year - , listings_latest_src_10004.created_at - , 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, isoyear) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC(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, isoyear) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , 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, isoyear) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 - ) subq_0 - ) subq_1 - ) subq_2 - GROUP BY - listing__country_latest -) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql deleted file mode 100644 index 3c0f240434..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuerySqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql +++ /dev/null @@ -1,17 +0,0 @@ --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - listing__country_latest - , SUM(listings) AS listings -FROM ( - -- Read Elements From Data Source 'listings_latest' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - country AS listing__country_latest - , 1 AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 -) subq_6 -GROUP BY - listing__country_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DatabricksSqlClient/test_local_dimension_using_local_identifier__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DatabricksSqlClient/test_local_dimension_using_local_identifier__plan0.sql deleted file mode 100644 index 2e7ec02d12..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DatabricksSqlClient/test_local_dimension_using_local_identifier__plan0.sql +++ /dev/null @@ -1,97 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_3.listing__country_latest - , subq_3.listings -FROM ( - -- Aggregate Measures - SELECT - subq_2.listing__country_latest - , SUM(subq_2.listings) AS listings - FROM ( - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - subq_1.listing__country_latest - , subq_1.listings - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.created_at - , subq_0.created_at__week - , subq_0.created_at__month - , subq_0.created_at__quarter - , subq_0.created_at__year - , subq_0.listing__ds - , subq_0.listing__ds__week - , subq_0.listing__ds__month - , subq_0.listing__ds__quarter - , subq_0.listing__ds__year - , subq_0.listing__created_at - , subq_0.listing__created_at__week - , subq_0.listing__created_at__month - , subq_0.listing__created_at__quarter - , subq_0.listing__created_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.user - , subq_0.listing__user - , subq_0.country_latest - , subq_0.is_lux_latest - , subq_0.capacity_latest - , subq_0.listing__country_latest - , subq_0.listing__is_lux_latest - , subq_0.listing__capacity_latest - , subq_0.listings - , subq_0.largest_listing - , subq_0.smallest_listing - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 - ) subq_0 - ) subq_1 - ) subq_2 - GROUP BY - subq_2.listing__country_latest -) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DatabricksSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DatabricksSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql deleted file mode 100644 index 3c0f240434..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DatabricksSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql +++ /dev/null @@ -1,17 +0,0 @@ --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - listing__country_latest - , SUM(listings) AS listings -FROM ( - -- Read Elements From Data Source 'listings_latest' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - country AS listing__country_latest - , 1 AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 -) subq_6 -GROUP BY - listing__country_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_constrain_primary_time_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_constrain_primary_time_dimension__plan0.sql deleted file mode 100644 index b642e30812..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_constrain_primary_time_dimension__plan0.sql +++ /dev/null @@ -1,60 +0,0 @@ --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - subq_1.bookings - , subq_1.ds -FROM ( - -- Pass Only Elements: - -- ['bookings', 'ds'] - SELECT - subq_0.bookings - , subq_0.ds - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , DATE_TRUNC('week', bookings_source_src_10000.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10000.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds) AS ds__year - , bookings_source_src_10000.ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , DATE_TRUNC('week', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__week - , DATE_TRUNC('month', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 -) subq_1 -WHERE ( - subq_1.ds >= CAST('2020-01-01' AS TIMESTAMP) -) AND ( - subq_1.ds <= CAST('2020-01-02' AS TIMESTAMP) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql deleted file mode 100644 index e5e1e2aaa5..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql +++ /dev/null @@ -1,16 +0,0 @@ --- Read Elements From Data Source 'bookings_source' --- Pass Only Elements: --- ['bookings', 'ds'] --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - 1 AS bookings - , ds -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 -WHERE ( - ds >= CAST('2020-01-01' AS TIMESTAMP) -) AND ( - ds <= CAST('2020-01-02' AS TIMESTAMP) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0.sql deleted file mode 100644 index 2e7ec02d12..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0.sql +++ /dev/null @@ -1,97 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_3.listing__country_latest - , subq_3.listings -FROM ( - -- Aggregate Measures - SELECT - subq_2.listing__country_latest - , SUM(subq_2.listings) AS listings - FROM ( - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - subq_1.listing__country_latest - , subq_1.listings - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.created_at - , subq_0.created_at__week - , subq_0.created_at__month - , subq_0.created_at__quarter - , subq_0.created_at__year - , subq_0.listing__ds - , subq_0.listing__ds__week - , subq_0.listing__ds__month - , subq_0.listing__ds__quarter - , subq_0.listing__ds__year - , subq_0.listing__created_at - , subq_0.listing__created_at__week - , subq_0.listing__created_at__month - , subq_0.listing__created_at__quarter - , subq_0.listing__created_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.user - , subq_0.listing__user - , subq_0.country_latest - , subq_0.is_lux_latest - , subq_0.capacity_latest - , subq_0.listing__country_latest - , subq_0.listing__is_lux_latest - , subq_0.listing__capacity_latest - , subq_0.listings - , subq_0.largest_listing - , subq_0.smallest_listing - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 - ) subq_0 - ) subq_1 - ) subq_2 - GROUP BY - subq_2.listing__country_latest -) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql deleted file mode 100644 index 3c0f240434..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDbSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql +++ /dev/null @@ -1,17 +0,0 @@ --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - listing__country_latest - , SUM(listings) AS listings -FROM ( - -- Read Elements From Data Source 'listings_latest' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - country AS listing__country_latest - , 1 AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 -) subq_6 -GROUP BY - listing__country_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_constrain_primary_time_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_constrain_primary_time_dimension__plan0.sql deleted file mode 100644 index b642e30812..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_constrain_primary_time_dimension__plan0.sql +++ /dev/null @@ -1,60 +0,0 @@ --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - subq_1.bookings - , subq_1.ds -FROM ( - -- Pass Only Elements: - -- ['bookings', 'ds'] - SELECT - subq_0.bookings - , subq_0.ds - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , DATE_TRUNC('week', bookings_source_src_10000.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10000.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds) AS ds__year - , bookings_source_src_10000.ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , DATE_TRUNC('week', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__week - , DATE_TRUNC('month', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 -) subq_1 -WHERE ( - subq_1.ds >= CAST('2020-01-01' AS TIMESTAMP) -) AND ( - subq_1.ds <= CAST('2020-01-02' AS TIMESTAMP) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql deleted file mode 100644 index e5e1e2aaa5..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql +++ /dev/null @@ -1,16 +0,0 @@ --- Read Elements From Data Source 'bookings_source' --- Pass Only Elements: --- ['bookings', 'ds'] --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - 1 AS bookings - , ds -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 -WHERE ( - ds >= CAST('2020-01-01' AS TIMESTAMP) -) AND ( - ds <= CAST('2020-01-02' AS TIMESTAMP) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0.sql deleted file mode 100644 index 2e7ec02d12..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0.sql +++ /dev/null @@ -1,97 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_3.listing__country_latest - , subq_3.listings -FROM ( - -- Aggregate Measures - SELECT - subq_2.listing__country_latest - , SUM(subq_2.listings) AS listings - FROM ( - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - subq_1.listing__country_latest - , subq_1.listings - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.created_at - , subq_0.created_at__week - , subq_0.created_at__month - , subq_0.created_at__quarter - , subq_0.created_at__year - , subq_0.listing__ds - , subq_0.listing__ds__week - , subq_0.listing__ds__month - , subq_0.listing__ds__quarter - , subq_0.listing__ds__year - , subq_0.listing__created_at - , subq_0.listing__created_at__week - , subq_0.listing__created_at__month - , subq_0.listing__created_at__quarter - , subq_0.listing__created_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.user - , subq_0.listing__user - , subq_0.country_latest - , subq_0.is_lux_latest - , subq_0.capacity_latest - , subq_0.listing__country_latest - , subq_0.listing__is_lux_latest - , subq_0.listing__capacity_latest - , subq_0.listings - , subq_0.largest_listing - , subq_0.smallest_listing - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 - ) subq_0 - ) subq_1 - ) subq_2 - GROUP BY - subq_2.listing__country_latest -) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql deleted file mode 100644 index 3c0f240434..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/PostgresSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql +++ /dev/null @@ -1,17 +0,0 @@ --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - listing__country_latest - , SUM(listings) AS listings -FROM ( - -- Read Elements From Data Source 'listings_latest' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - country AS listing__country_latest - , 1 AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 -) subq_6 -GROUP BY - listing__country_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_constrain_primary_time_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_constrain_primary_time_dimension__plan0.sql deleted file mode 100644 index b642e30812..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_constrain_primary_time_dimension__plan0.sql +++ /dev/null @@ -1,60 +0,0 @@ --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - subq_1.bookings - , subq_1.ds -FROM ( - -- Pass Only Elements: - -- ['bookings', 'ds'] - SELECT - subq_0.bookings - , subq_0.ds - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , DATE_TRUNC('week', bookings_source_src_10000.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10000.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds) AS ds__year - , bookings_source_src_10000.ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , DATE_TRUNC('week', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__week - , DATE_TRUNC('month', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 -) subq_1 -WHERE ( - subq_1.ds >= CAST('2020-01-01' AS TIMESTAMP) -) AND ( - subq_1.ds <= CAST('2020-01-02' AS TIMESTAMP) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql deleted file mode 100644 index e5e1e2aaa5..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql +++ /dev/null @@ -1,16 +0,0 @@ --- Read Elements From Data Source 'bookings_source' --- Pass Only Elements: --- ['bookings', 'ds'] --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - 1 AS bookings - , ds -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 -WHERE ( - ds >= CAST('2020-01-01' AS TIMESTAMP) -) AND ( - ds <= CAST('2020-01-02' AS TIMESTAMP) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_local_dimension_using_local_identifier__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_local_dimension_using_local_identifier__plan0.sql deleted file mode 100644 index 2e7ec02d12..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_local_dimension_using_local_identifier__plan0.sql +++ /dev/null @@ -1,97 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_3.listing__country_latest - , subq_3.listings -FROM ( - -- Aggregate Measures - SELECT - subq_2.listing__country_latest - , SUM(subq_2.listings) AS listings - FROM ( - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - subq_1.listing__country_latest - , subq_1.listings - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.created_at - , subq_0.created_at__week - , subq_0.created_at__month - , subq_0.created_at__quarter - , subq_0.created_at__year - , subq_0.listing__ds - , subq_0.listing__ds__week - , subq_0.listing__ds__month - , subq_0.listing__ds__quarter - , subq_0.listing__ds__year - , subq_0.listing__created_at - , subq_0.listing__created_at__week - , subq_0.listing__created_at__month - , subq_0.listing__created_at__quarter - , subq_0.listing__created_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.user - , subq_0.listing__user - , subq_0.country_latest - , subq_0.is_lux_latest - , subq_0.capacity_latest - , subq_0.listing__country_latest - , subq_0.listing__is_lux_latest - , subq_0.listing__capacity_latest - , subq_0.listings - , subq_0.largest_listing - , subq_0.smallest_listing - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 - ) subq_0 - ) subq_1 - ) subq_2 - GROUP BY - subq_2.listing__country_latest -) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql deleted file mode 100644 index 3c0f240434..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/RedshiftSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql +++ /dev/null @@ -1,17 +0,0 @@ --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - listing__country_latest - , SUM(listings) AS listings -FROM ( - -- Read Elements From Data Source 'listings_latest' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - country AS listing__country_latest - , 1 AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 -) subq_6 -GROUP BY - listing__country_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_constrain_primary_time_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_constrain_primary_time_dimension__plan0.sql deleted file mode 100644 index b642e30812..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_constrain_primary_time_dimension__plan0.sql +++ /dev/null @@ -1,60 +0,0 @@ --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - subq_1.bookings - , subq_1.ds -FROM ( - -- Pass Only Elements: - -- ['bookings', 'ds'] - SELECT - subq_0.bookings - , subq_0.ds - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , DATE_TRUNC('week', bookings_source_src_10000.ds) AS ds__week - , DATE_TRUNC('month', bookings_source_src_10000.ds) AS ds__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds) AS ds__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds) AS ds__year - , bookings_source_src_10000.ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds_partitioned) AS ds_partitioned__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , DATE_TRUNC('week', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__week - , DATE_TRUNC('month', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds) AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , DATE_TRUNC('week', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , DATE_TRUNC('month', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , DATE_TRUNC('quarter', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , DATE_TRUNC('year', bookings_source_src_10000.ds_partitioned) AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 -) subq_1 -WHERE ( - subq_1.ds >= CAST('2020-01-01' AS TIMESTAMP) -) AND ( - subq_1.ds <= CAST('2020-01-02' AS TIMESTAMP) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql deleted file mode 100644 index e5e1e2aaa5..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_constrain_primary_time_dimension__plan0_optimized.sql +++ /dev/null @@ -1,16 +0,0 @@ --- Read Elements From Data Source 'bookings_source' --- Pass Only Elements: --- ['bookings', 'ds'] --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - 1 AS bookings - , ds -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 -WHERE ( - ds >= CAST('2020-01-01' AS TIMESTAMP) -) AND ( - ds <= CAST('2020-01-02' AS TIMESTAMP) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_local_dimension_using_local_identifier__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_local_dimension_using_local_identifier__plan0.sql deleted file mode 100644 index 2e7ec02d12..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_local_dimension_using_local_identifier__plan0.sql +++ /dev/null @@ -1,97 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_3.listing__country_latest - , subq_3.listings -FROM ( - -- Aggregate Measures - SELECT - subq_2.listing__country_latest - , SUM(subq_2.listings) AS listings - FROM ( - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - subq_1.listing__country_latest - , subq_1.listings - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.created_at - , subq_0.created_at__week - , subq_0.created_at__month - , subq_0.created_at__quarter - , subq_0.created_at__year - , subq_0.listing__ds - , subq_0.listing__ds__week - , subq_0.listing__ds__month - , subq_0.listing__ds__quarter - , subq_0.listing__ds__year - , subq_0.listing__created_at - , subq_0.listing__created_at__week - , subq_0.listing__created_at__month - , subq_0.listing__created_at__quarter - , subq_0.listing__created_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.user - , subq_0.listing__user - , subq_0.country_latest - , subq_0.is_lux_latest - , subq_0.capacity_latest - , subq_0.listing__country_latest - , subq_0.listing__is_lux_latest - , subq_0.listing__capacity_latest - , subq_0.listings - , subq_0.largest_listing - , subq_0.smallest_listing - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10004.capacity AS largest_listing - , listings_latest_src_10004.capacity AS smallest_listing - , listings_latest_src_10004.created_at AS ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , listings_latest_src_10004.created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , listings_latest_src_10004.country AS country_latest - , listings_latest_src_10004.is_lux AS is_lux_latest - , listings_latest_src_10004.capacity AS capacity_latest - , listings_latest_src_10004.created_at AS listing__ds - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__ds__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , listings_latest_src_10004.created_at AS listing__created_at - , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week - , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month - , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter - , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , listings_latest_src_10004.country AS listing__country_latest - , listings_latest_src_10004.is_lux AS listing__is_lux_latest - , listings_latest_src_10004.capacity AS listing__capacity_latest - , listings_latest_src_10004.listing_id AS listing - , listings_latest_src_10004.user_id AS user - , listings_latest_src_10004.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10004 - ) subq_0 - ) subq_1 - ) subq_2 - GROUP BY - subq_2.listing__country_latest -) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql deleted file mode 100644 index 3c0f240434..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SnowflakeSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql +++ /dev/null @@ -1,17 +0,0 @@ --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - listing__country_latest - , SUM(listings) AS listings -FROM ( - -- Read Elements From Data Source 'listings_latest' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - country AS listing__country_latest - , 1 AS listings - FROM ***************************.dim_listings_latest listings_latest_src_10004 -) subq_6 -GROUP BY - listing__country_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_compute_metrics_node__plan0.sql deleted file mode 100644 index 56e15d3357..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_compute_metrics_node__plan0.sql +++ /dev/null @@ -1,130 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_5.bookings - , subq_5.listing__country_latest - , subq_5.listing -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_4.bookings) AS bookings - , subq_4.listing__country_latest - , subq_4.listing - FROM ( - -- Join Standard Outputs - SELECT - subq_1.bookings AS bookings - , subq_3.country_latest AS listing__country_latest - , subq_1.listing AS listing - FROM ( - -- Pass Only Elements: - -- ['bookings', 'listing'] - SELECT - subq_0.bookings - , subq_0.listing - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 - ) subq_1 - LEFT OUTER JOIN ( - -- Pass Only Elements: - -- ['listing', 'country_latest'] - SELECT - subq_2.country_latest - , subq_2.listing - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10003.capacity AS largest_listing - , listings_latest_src_10003.capacity AS smallest_listing - , listings_latest_src_10003.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , listings_latest_src_10003.created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__year - , listings_latest_src_10003.country AS country_latest - , listings_latest_src_10003.is_lux AS is_lux_latest - , listings_latest_src_10003.capacity AS capacity_latest - , listings_latest_src_10003.created_at AS listing__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__year - , listings_latest_src_10003.created_at AS listing__created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__year - , listings_latest_src_10003.country AS listing__country_latest - , listings_latest_src_10003.is_lux AS listing__is_lux_latest - , listings_latest_src_10003.capacity AS listing__capacity_latest - , listings_latest_src_10003.listing_id AS listing - , listings_latest_src_10003.user_id AS user - , listings_latest_src_10003.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10003 - ) subq_2 - ) subq_3 - ON - subq_1.listing = subq_3.listing - ) subq_4 - GROUP BY - subq_4.listing__country_latest - , subq_4.listing -) subq_5 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_compute_metrics_node_simple_expr__plan0.sql deleted file mode 100644 index d504fbf604..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_compute_metrics_node_simple_expr__plan0.sql +++ /dev/null @@ -1,130 +0,0 @@ --- Compute Metrics via Expressions -SELECT - booking_value * 0.05 AS booking_fees - , subq_5.listing__country_latest - , subq_5.listing -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_4.booking_value) AS booking_value - , subq_4.listing__country_latest - , subq_4.listing - FROM ( - -- Join Standard Outputs - SELECT - subq_1.booking_value AS booking_value - , subq_3.country_latest AS listing__country_latest - , subq_1.listing AS listing - FROM ( - -- Pass Only Elements: - -- ['booking_value', 'listing'] - SELECT - subq_0.booking_value - , subq_0.listing - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 - ) subq_1 - LEFT OUTER JOIN ( - -- Pass Only Elements: - -- ['listing', 'country_latest'] - SELECT - subq_2.country_latest - , subq_2.listing - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10003.capacity AS largest_listing - , listings_latest_src_10003.capacity AS smallest_listing - , listings_latest_src_10003.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , listings_latest_src_10003.created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__year - , listings_latest_src_10003.country AS country_latest - , listings_latest_src_10003.is_lux AS is_lux_latest - , listings_latest_src_10003.capacity AS capacity_latest - , listings_latest_src_10003.created_at AS listing__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__year - , listings_latest_src_10003.created_at AS listing__created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__year - , listings_latest_src_10003.country AS listing__country_latest - , listings_latest_src_10003.is_lux AS listing__is_lux_latest - , listings_latest_src_10003.capacity AS listing__capacity_latest - , listings_latest_src_10003.listing_id AS listing - , listings_latest_src_10003.user_id AS user - , listings_latest_src_10003.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10003 - ) subq_2 - ) subq_3 - ON - subq_1.listing = subq_3.listing - ) subq_4 - GROUP BY - subq_4.listing__country_latest - , subq_4.listing -) subq_5 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_constrain_time_range_node__plan0.sql deleted file mode 100644 index e28f6a2bd1..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_constrain_time_range_node__plan0.sql +++ /dev/null @@ -1,79 +0,0 @@ --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - subq_2.bookings - , subq_2.ds - , subq_2.metric_time -FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_1.bookings - , subq_1.ds - , subq_1.ds AS metric_time - FROM ( - -- Pass Only Elements: - -- ['bookings', 'ds'] - SELECT - subq_0.bookings - , subq_0.ds - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 - ) subq_1 -) subq_2 -WHERE ( - subq_2.metric_time >= CAST('2020-01-01' AS TEXT) -) AND ( - subq_2.metric_time <= CAST('2020-01-02' AS TEXT) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_constrain_time_range_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_constrain_time_range_node__plan0_optimized.sql deleted file mode 100644 index 3ae6090225..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_constrain_time_range_node__plan0_optimized.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Read Elements From Data Source 'bookings_source' --- Pass Only Elements: --- ['bookings', 'ds'] --- Metric Time Dimension 'ds' --- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-02T00:00:00] -SELECT - 1 AS bookings - , ds - , ds AS metric_time -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 -WHERE ( - ds >= CAST('2020-01-01' AS TEXT) -) AND ( - ds <= CAST('2020-01-02' AS TEXT) -) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric__plan0.sql deleted file mode 100644 index 171a6acc76..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric__plan0.sql +++ /dev/null @@ -1,50 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_4.txn_revenue AS trailing_2_months_revenue - , subq_4.ds__month -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_3.txn_revenue) AS txn_revenue - , subq_3.ds__month - FROM ( - -- Pass Only Elements: - -- ['txn_revenue', 'ds__month'] - SELECT - subq_1.txn_revenue - , subq_1.ds__month - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.txn_revenue - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.user - FROM ( - -- Read Elements From Data Source 'revenue' - SELECT - revenue_src_10005.revenue AS txn_revenue - , revenue_src_10005.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , revenue_src_10005.user_id AS user - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue - ) revenue_src_10005 - ) subq_0 - ) subq_1 - ) subq_3 - GROUP BY - subq_3.ds__month -) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric__plan0_optimized.sql deleted file mode 100644 index c324243576..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric__plan0_optimized.sql +++ /dev/null @@ -1,15 +0,0 @@ --- Read Elements From Data Source 'revenue' --- Metric Time Dimension 'ds' --- Pass Only Elements: --- ['txn_revenue', 'ds__month'] --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(revenue) AS trailing_2_months_revenue - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue -) revenue_src_10005 -GROUP BY - '__DATE_TRUNC_NOT_SUPPORTED__' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_grain_to_date__plan0.sql deleted file mode 100644 index 1e9ab0d683..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_grain_to_date__plan0.sql +++ /dev/null @@ -1,50 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_4.txn_revenue AS revenue_mtd - , subq_4.ds__month -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_3.txn_revenue) AS txn_revenue - , subq_3.ds__month - FROM ( - -- Pass Only Elements: - -- ['txn_revenue', 'ds__month'] - SELECT - subq_1.txn_revenue - , subq_1.ds__month - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.txn_revenue - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.user - FROM ( - -- Read Elements From Data Source 'revenue' - SELECT - revenue_src_10005.revenue AS txn_revenue - , revenue_src_10005.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , revenue_src_10005.user_id AS user - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue - ) revenue_src_10005 - ) subq_0 - ) subq_1 - ) subq_3 - GROUP BY - subq_3.ds__month -) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_grain_to_date__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_grain_to_date__plan0_optimized.sql deleted file mode 100644 index c76757ec94..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_grain_to_date__plan0_optimized.sql +++ /dev/null @@ -1,15 +0,0 @@ --- Read Elements From Data Source 'revenue' --- Metric Time Dimension 'ds' --- Pass Only Elements: --- ['txn_revenue', 'ds__month'] --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(revenue) AS revenue_mtd - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue -) revenue_src_10005 -GROUP BY - '__DATE_TRUNC_NOT_SUPPORTED__' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_ds__plan0.sql deleted file mode 100644 index 219cfacb5c..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_ds__plan0.sql +++ /dev/null @@ -1,45 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_4.txn_revenue AS trailing_2_months_revenue -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_3.txn_revenue) AS txn_revenue - FROM ( - -- Pass Only Elements: - -- ['txn_revenue'] - SELECT - subq_1.txn_revenue - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.txn_revenue - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.user - FROM ( - -- Read Elements From Data Source 'revenue' - SELECT - revenue_src_10005.revenue AS txn_revenue - , revenue_src_10005.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , revenue_src_10005.user_id AS user - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue - ) revenue_src_10005 - ) subq_0 - ) subq_1 - ) subq_3 -) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_ds__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_ds__plan0_optimized.sql deleted file mode 100644 index 2fd076a2ae..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_ds__plan0_optimized.sql +++ /dev/null @@ -1,12 +0,0 @@ --- Read Elements From Data Source 'revenue' --- Metric Time Dimension 'ds' --- Pass Only Elements: --- ['txn_revenue'] --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(revenue) AS trailing_2_months_revenue -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue -) revenue_src_10005 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window__plan0.sql deleted file mode 100644 index 739aee1067..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window__plan0.sql +++ /dev/null @@ -1,50 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_4.txn_revenue AS revenue_all_time - , subq_4.ds__month -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_3.txn_revenue) AS txn_revenue - , subq_3.ds__month - FROM ( - -- Pass Only Elements: - -- ['txn_revenue', 'ds__month'] - SELECT - subq_1.txn_revenue - , subq_1.ds__month - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.txn_revenue - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.user - FROM ( - -- Read Elements From Data Source 'revenue' - SELECT - revenue_src_10005.revenue AS txn_revenue - , revenue_src_10005.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , revenue_src_10005.user_id AS user - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue - ) revenue_src_10005 - ) subq_0 - ) subq_1 - ) subq_3 - GROUP BY - subq_3.ds__month -) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window__plan0_optimized.sql deleted file mode 100644 index 93d4f0fa34..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window__plan0_optimized.sql +++ /dev/null @@ -1,15 +0,0 @@ --- Read Elements From Data Source 'revenue' --- Metric Time Dimension 'ds' --- Pass Only Elements: --- ['txn_revenue', 'ds__month'] --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(revenue) AS revenue_all_time - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue -) revenue_src_10005 -GROUP BY - '__DATE_TRUNC_NOT_SUPPORTED__' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0.sql deleted file mode 100644 index 671a9ddf08..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ /dev/null @@ -1,71 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_5.txn_revenue AS revenue_all_time - , subq_5.ds__month -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_4.txn_revenue) AS txn_revenue - , subq_4.ds__month - FROM ( - -- Pass Only Elements: - -- ['txn_revenue', 'ds__month'] - SELECT - subq_2.txn_revenue - , subq_2.ds__month - FROM ( - -- Constrain Time Range to [2000-01-01T00:00:00, 2020-01-01T00:00:00] - SELECT - subq_1.txn_revenue - , subq_1.ds - , subq_1.ds__week - , subq_1.ds__month - , subq_1.ds__quarter - , subq_1.ds__year - , subq_1.metric_time - , subq_1.metric_time__week - , subq_1.metric_time__month - , subq_1.metric_time__quarter - , subq_1.metric_time__year - , subq_1.user - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.txn_revenue - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.user - FROM ( - -- Read Elements From Data Source 'revenue' - SELECT - revenue_src_10005.revenue AS txn_revenue - , revenue_src_10005.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , revenue_src_10005.user_id AS user - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue - ) revenue_src_10005 - ) subq_0 - ) subq_1 - WHERE ( - subq_1.metric_time >= CAST('2000-01-01' AS TEXT) - ) AND ( - subq_1.metric_time <= CAST('2020-01-01' AS TEXT) - ) - ) subq_2 - ) subq_4 - GROUP BY - subq_4.ds__month -) subq_5 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql deleted file mode 100644 index 34566bc3e7..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql +++ /dev/null @@ -1,21 +0,0 @@ --- Read Elements From Data Source 'revenue' --- Metric Time Dimension 'ds' --- Constrain Time Range to [2000-01-01T00:00:00, 2020-01-01T00:00:00] --- Pass Only Elements: --- ['txn_revenue', 'ds__month'] --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(revenue) AS revenue_all_time - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue -) revenue_src_10005 -WHERE ( - created_at >= CAST('2000-01-01' AS TEXT) -) AND ( - created_at <= CAST('2020-01-01' AS TEXT) -) -GROUP BY - '__DATE_TRUNC_NOT_SUPPORTED__' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_with_time_constraint__plan0.sql deleted file mode 100644 index f41da1e8dc..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_with_time_constraint__plan0.sql +++ /dev/null @@ -1,71 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_5.txn_revenue AS trailing_2_months_revenue - , subq_5.ds__month -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_4.txn_revenue) AS txn_revenue - , subq_4.ds__month - FROM ( - -- Pass Only Elements: - -- ['txn_revenue', 'ds__month'] - SELECT - subq_2.txn_revenue - , subq_2.ds__month - FROM ( - -- Constrain Time Range to [2019-12-01T00:00:00, 2020-01-01T00:00:00] - SELECT - subq_1.txn_revenue - , subq_1.ds - , subq_1.ds__week - , subq_1.ds__month - , subq_1.ds__quarter - , subq_1.ds__year - , subq_1.metric_time - , subq_1.metric_time__week - , subq_1.metric_time__month - , subq_1.metric_time__quarter - , subq_1.metric_time__year - , subq_1.user - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.txn_revenue - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.user - FROM ( - -- Read Elements From Data Source 'revenue' - SELECT - revenue_src_10005.revenue AS txn_revenue - , revenue_src_10005.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , revenue_src_10005.user_id AS user - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue - ) revenue_src_10005 - ) subq_0 - ) subq_1 - WHERE ( - subq_1.metric_time >= CAST('2019-12-01' AS TEXT) - ) AND ( - subq_1.metric_time <= CAST('2020-01-01' AS TEXT) - ) - ) subq_2 - ) subq_4 - GROUP BY - subq_4.ds__month -) subq_5 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_with_time_constraint__plan0_optimized.sql deleted file mode 100644 index 6de4086fd9..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_cumulative_metric_with_time_constraint__plan0_optimized.sql +++ /dev/null @@ -1,21 +0,0 @@ --- Read Elements From Data Source 'revenue' --- Metric Time Dimension 'ds' --- Constrain Time Range to [2019-12-01T00:00:00, 2020-01-01T00:00:00] --- Pass Only Elements: --- ['txn_revenue', 'ds__month'] --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(revenue) AS trailing_2_months_revenue - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_revenue -) revenue_src_10005 -WHERE ( - created_at >= CAST('2019-12-01' AS TEXT) -) AND ( - created_at <= CAST('2020-01-01' AS TEXT) -) -GROUP BY - '__DATE_TRUNC_NOT_SUPPORTED__' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_distinct_values__plan0.sql deleted file mode 100644 index 6f43cf007b..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_distinct_values__plan0.sql +++ /dev/null @@ -1,243 +0,0 @@ --- Order By ['listing__country_latest'] Limit 100 -SELECT - subq_10.listing__country_latest -FROM ( - -- Pass Only Elements: - -- ['listing__country_latest'] - SELECT - subq_9.listing__country_latest - FROM ( - -- Compute Metrics via Expressions - SELECT - subq_8.bookings - , subq_8.listing__country_latest - FROM ( - -- Aggregate Measures - SELECT - SUM(subq_7.bookings) AS bookings - , subq_7.listing__country_latest - FROM ( - -- Pass Only Elements: - -- ['bookings', 'listing__country_latest'] - SELECT - subq_6.bookings - , subq_6.listing__country_latest - FROM ( - -- Join Standard Outputs - SELECT - subq_2.bookings AS bookings - , subq_5.country_latest AS listing__country_latest - , subq_2.listing AS listing - FROM ( - -- Pass Only Elements: - -- ['bookings', 'listing'] - SELECT - subq_1.bookings - , subq_1.listing - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.bookings - , subq_0.instant_bookings - , subq_0.booking_value - , subq_0.max_booking_value - , subq_0.min_booking_value - , subq_0.bookers - , subq_0.average_booking_value - , subq_0.is_instant - , subq_0.create_a_cycle_in_the_join_graph__is_instant - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds_partitioned - , subq_0.ds_partitioned__week - , subq_0.ds_partitioned__month - , subq_0.ds_partitioned__quarter - , subq_0.ds_partitioned__year - , subq_0.booking_paid_at - , subq_0.booking_paid_at__week - , subq_0.booking_paid_at__month - , subq_0.booking_paid_at__quarter - , subq_0.booking_paid_at__year - , subq_0.create_a_cycle_in_the_join_graph__ds - , subq_0.create_a_cycle_in_the_join_graph__ds__week - , subq_0.create_a_cycle_in_the_join_graph__ds__month - , subq_0.create_a_cycle_in_the_join_graph__ds__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds__year - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__week - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__month - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__year - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__week - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__month - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.guest - , subq_0.host - , subq_0.create_a_cycle_in_the_join_graph - , subq_0.create_a_cycle_in_the_join_graph__listing - , subq_0.create_a_cycle_in_the_join_graph__guest - , subq_0.create_a_cycle_in_the_join_graph__host - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 - ) subq_1 - ) subq_2 - LEFT OUTER JOIN ( - -- Pass Only Elements: - -- ['listing', 'country_latest'] - SELECT - subq_4.country_latest - , subq_4.listing - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_3.listings - , subq_3.largest_listing - , subq_3.smallest_listing - , subq_3.country_latest - , subq_3.is_lux_latest - , subq_3.capacity_latest - , subq_3.listing__country_latest - , subq_3.listing__is_lux_latest - , subq_3.listing__capacity_latest - , subq_3.ds - , subq_3.ds__week - , subq_3.ds__month - , subq_3.ds__quarter - , subq_3.ds__year - , subq_3.created_at - , subq_3.created_at__week - , subq_3.created_at__month - , subq_3.created_at__quarter - , subq_3.created_at__year - , subq_3.listing__ds - , subq_3.listing__ds__week - , subq_3.listing__ds__month - , subq_3.listing__ds__quarter - , subq_3.listing__ds__year - , subq_3.listing__created_at - , subq_3.listing__created_at__week - , subq_3.listing__created_at__month - , subq_3.listing__created_at__quarter - , subq_3.listing__created_at__year - , subq_3.ds AS metric_time - , subq_3.ds__week AS metric_time__week - , subq_3.ds__month AS metric_time__month - , subq_3.ds__quarter AS metric_time__quarter - , subq_3.ds__year AS metric_time__year - , subq_3.listing - , subq_3.user - , subq_3.listing__user - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10003.capacity AS largest_listing - , listings_latest_src_10003.capacity AS smallest_listing - , listings_latest_src_10003.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , listings_latest_src_10003.created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__year - , listings_latest_src_10003.country AS country_latest - , listings_latest_src_10003.is_lux AS is_lux_latest - , listings_latest_src_10003.capacity AS capacity_latest - , listings_latest_src_10003.created_at AS listing__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__year - , listings_latest_src_10003.created_at AS listing__created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__year - , listings_latest_src_10003.country AS listing__country_latest - , listings_latest_src_10003.is_lux AS listing__is_lux_latest - , listings_latest_src_10003.capacity AS listing__capacity_latest - , listings_latest_src_10003.listing_id AS listing - , listings_latest_src_10003.user_id AS user - , listings_latest_src_10003.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10003 - ) subq_3 - ) subq_4 - ) subq_5 - ON - subq_2.listing = subq_5.listing - ) subq_6 - ) subq_7 - GROUP BY - subq_7.listing__country_latest - ) subq_8 - ) subq_9 -) subq_10 -ORDER BY subq_10.listing__country_latest -LIMIT 100 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_node__plan0.sql deleted file mode 100644 index 4ac55f67ae..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_node__plan0.sql +++ /dev/null @@ -1,59 +0,0 @@ --- Pass Only Elements: --- ['bookings'] -SELECT - subq_0.bookings -FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 -) subq_0 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_with_where_constraint_node__plan0.sql deleted file mode 100644 index 65096a1a3c..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_with_where_constraint_node__plan0.sql +++ /dev/null @@ -1,67 +0,0 @@ --- Constrain Output with WHERE -SELECT - subq_1.bookings - , subq_1.ds -FROM ( - -- Pass Only Elements: - -- ['bookings', 'ds'] - SELECT - subq_0.bookings - , subq_0.ds - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 -) subq_1 -WHERE ds = '2020-01-01' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_with_where_constraint_on_join_dim__plan0.sql deleted file mode 100644 index 67e33217e5..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ /dev/null @@ -1,248 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_10.bookings - , subq_10.is_instant -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_9.bookings) AS bookings - , subq_9.is_instant - FROM ( - -- Pass Only Elements: - -- ['bookings', 'is_instant'] - SELECT - subq_8.bookings - , subq_8.is_instant - FROM ( - -- Constrain Output with WHERE - SELECT - subq_7.bookings - , subq_7.is_instant - , subq_7.listing__country_latest - FROM ( - -- Pass Only Elements: - -- ['bookings', 'is_instant', 'listing__country_latest'] - SELECT - subq_6.bookings - , subq_6.is_instant - , subq_6.listing__country_latest - FROM ( - -- Join Standard Outputs - SELECT - subq_2.bookings AS bookings - , subq_2.is_instant AS is_instant - , subq_5.country_latest AS listing__country_latest - , subq_2.listing AS listing - FROM ( - -- Pass Only Elements: - -- ['bookings', 'is_instant', 'listing'] - SELECT - subq_1.bookings - , subq_1.is_instant - , subq_1.listing - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.bookings - , subq_0.instant_bookings - , subq_0.booking_value - , subq_0.max_booking_value - , subq_0.min_booking_value - , subq_0.bookers - , subq_0.average_booking_value - , subq_0.is_instant - , subq_0.create_a_cycle_in_the_join_graph__is_instant - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds_partitioned - , subq_0.ds_partitioned__week - , subq_0.ds_partitioned__month - , subq_0.ds_partitioned__quarter - , subq_0.ds_partitioned__year - , subq_0.booking_paid_at - , subq_0.booking_paid_at__week - , subq_0.booking_paid_at__month - , subq_0.booking_paid_at__quarter - , subq_0.booking_paid_at__year - , subq_0.create_a_cycle_in_the_join_graph__ds - , subq_0.create_a_cycle_in_the_join_graph__ds__week - , subq_0.create_a_cycle_in_the_join_graph__ds__month - , subq_0.create_a_cycle_in_the_join_graph__ds__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds__year - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__week - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__month - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__year - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__week - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__month - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.guest - , subq_0.host - , subq_0.create_a_cycle_in_the_join_graph - , subq_0.create_a_cycle_in_the_join_graph__listing - , subq_0.create_a_cycle_in_the_join_graph__guest - , subq_0.create_a_cycle_in_the_join_graph__host - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 - ) subq_1 - ) subq_2 - LEFT OUTER JOIN ( - -- Pass Only Elements: - -- ['listing', 'country_latest'] - SELECT - subq_4.country_latest - , subq_4.listing - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_3.listings - , subq_3.largest_listing - , subq_3.smallest_listing - , subq_3.country_latest - , subq_3.is_lux_latest - , subq_3.capacity_latest - , subq_3.listing__country_latest - , subq_3.listing__is_lux_latest - , subq_3.listing__capacity_latest - , subq_3.ds - , subq_3.ds__week - , subq_3.ds__month - , subq_3.ds__quarter - , subq_3.ds__year - , subq_3.created_at - , subq_3.created_at__week - , subq_3.created_at__month - , subq_3.created_at__quarter - , subq_3.created_at__year - , subq_3.listing__ds - , subq_3.listing__ds__week - , subq_3.listing__ds__month - , subq_3.listing__ds__quarter - , subq_3.listing__ds__year - , subq_3.listing__created_at - , subq_3.listing__created_at__week - , subq_3.listing__created_at__month - , subq_3.listing__created_at__quarter - , subq_3.listing__created_at__year - , subq_3.ds AS metric_time - , subq_3.ds__week AS metric_time__week - , subq_3.ds__month AS metric_time__month - , subq_3.ds__quarter AS metric_time__quarter - , subq_3.ds__year AS metric_time__year - , subq_3.listing - , subq_3.user - , subq_3.listing__user - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10003.capacity AS largest_listing - , listings_latest_src_10003.capacity AS smallest_listing - , listings_latest_src_10003.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , listings_latest_src_10003.created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__year - , listings_latest_src_10003.country AS country_latest - , listings_latest_src_10003.is_lux AS is_lux_latest - , listings_latest_src_10003.capacity AS capacity_latest - , listings_latest_src_10003.created_at AS listing__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__year - , listings_latest_src_10003.created_at AS listing__created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__year - , listings_latest_src_10003.country AS listing__country_latest - , listings_latest_src_10003.is_lux AS listing__is_lux_latest - , listings_latest_src_10003.capacity AS listing__capacity_latest - , listings_latest_src_10003.listing_id AS listing - , listings_latest_src_10003.user_id AS user - , listings_latest_src_10003.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10003 - ) subq_3 - ) subq_4 - ) subq_5 - ON - subq_2.listing = subq_5.listing - ) subq_6 - ) subq_7 - WHERE listing__country_latest = 'us' - ) subq_8 - ) subq_9 - GROUP BY - subq_9.is_instant -) subq_10 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql deleted file mode 100644 index f69f9412a9..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_filter_with_where_constraint_on_join_dim__plan0_optimized.sql +++ /dev/null @@ -1,38 +0,0 @@ --- Constrain Output with WHERE --- Pass Only Elements: --- ['bookings', 'is_instant'] --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(bookings) AS bookings - , is_instant -FROM ( - -- Join Standard Outputs - -- Pass Only Elements: - -- ['bookings', 'is_instant', 'listing__country_latest'] - SELECT - subq_13.bookings AS bookings - , subq_13.is_instant AS is_instant - , listings_latest_src_10003.country AS listing__country_latest - FROM ( - -- Read Elements From Data Source 'bookings_source' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: - -- ['bookings', 'is_instant', 'listing'] - SELECT - 1 AS bookings - , is_instant - , listing_id AS listing - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_13 - LEFT OUTER JOIN - ***************************.dim_listings_latest listings_latest_src_10003 - ON - subq_13.listing = listings_latest_src_10003.listing_id -) subq_18 -WHERE listing__country_latest = 'us' -GROUP BY - is_instant diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_limit_rows__plan0.sql deleted file mode 100644 index 5499dc0ff7..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_limit_rows__plan0.sql +++ /dev/null @@ -1,136 +0,0 @@ --- Order By [] Limit 1 -SELECT - subq_4.bookings - , subq_4.ds -FROM ( - -- Compute Metrics via Expressions - SELECT - subq_3.bookings - , subq_3.ds - FROM ( - -- Aggregate Measures - SELECT - SUM(subq_2.bookings) AS bookings - , subq_2.ds - FROM ( - -- Pass Only Elements: - -- ['bookings', 'ds'] - SELECT - subq_1.bookings - , subq_1.ds - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.bookings - , subq_0.instant_bookings - , subq_0.booking_value - , subq_0.max_booking_value - , subq_0.min_booking_value - , subq_0.bookers - , subq_0.average_booking_value - , subq_0.is_instant - , subq_0.create_a_cycle_in_the_join_graph__is_instant - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds_partitioned - , subq_0.ds_partitioned__week - , subq_0.ds_partitioned__month - , subq_0.ds_partitioned__quarter - , subq_0.ds_partitioned__year - , subq_0.booking_paid_at - , subq_0.booking_paid_at__week - , subq_0.booking_paid_at__month - , subq_0.booking_paid_at__quarter - , subq_0.booking_paid_at__year - , subq_0.create_a_cycle_in_the_join_graph__ds - , subq_0.create_a_cycle_in_the_join_graph__ds__week - , subq_0.create_a_cycle_in_the_join_graph__ds__month - , subq_0.create_a_cycle_in_the_join_graph__ds__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds__year - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__week - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__month - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__year - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__week - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__month - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.guest - , subq_0.host - , subq_0.create_a_cycle_in_the_join_graph - , subq_0.create_a_cycle_in_the_join_graph__listing - , subq_0.create_a_cycle_in_the_join_graph__guest - , subq_0.create_a_cycle_in_the_join_graph__host - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 - ) subq_1 - ) subq_2 - GROUP BY - subq_2.ds - ) subq_3 -) subq_4 -LIMIT 1 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_limit_rows__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_limit_rows__plan0_optimized.sql deleted file mode 100644 index 190ad95011..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_limit_rows__plan0_optimized.sql +++ /dev/null @@ -1,22 +0,0 @@ --- Aggregate Measures --- Compute Metrics via Expressions --- Order By [] Limit 1 -SELECT - SUM(bookings) AS bookings - , ds -FROM ( - -- Read Elements From Data Source 'bookings_source' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: - -- ['bookings', 'ds'] - SELECT - 1 AS bookings - , ds - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 -) subq_7 -GROUP BY - ds -LIMIT 1 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_local_dimension_using_local_identifier__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_local_dimension_using_local_identifier__plan0.sql deleted file mode 100644 index c06b5b66c8..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_local_dimension_using_local_identifier__plan0.sql +++ /dev/null @@ -1,97 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_3.listings - , subq_3.listing__country_latest -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_2.listings) AS listings - , subq_2.listing__country_latest - FROM ( - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - subq_1.listings - , subq_1.listing__country_latest - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.listings - , subq_0.largest_listing - , subq_0.smallest_listing - , subq_0.country_latest - , subq_0.is_lux_latest - , subq_0.capacity_latest - , subq_0.listing__country_latest - , subq_0.listing__is_lux_latest - , subq_0.listing__capacity_latest - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.created_at - , subq_0.created_at__week - , subq_0.created_at__month - , subq_0.created_at__quarter - , subq_0.created_at__year - , subq_0.listing__ds - , subq_0.listing__ds__week - , subq_0.listing__ds__month - , subq_0.listing__ds__quarter - , subq_0.listing__ds__year - , subq_0.listing__created_at - , subq_0.listing__created_at__week - , subq_0.listing__created_at__month - , subq_0.listing__created_at__quarter - , subq_0.listing__created_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.user - , subq_0.listing__user - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10003.capacity AS largest_listing - , listings_latest_src_10003.capacity AS smallest_listing - , listings_latest_src_10003.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , listings_latest_src_10003.created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__year - , listings_latest_src_10003.country AS country_latest - , listings_latest_src_10003.is_lux AS is_lux_latest - , listings_latest_src_10003.capacity AS capacity_latest - , listings_latest_src_10003.created_at AS listing__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__year - , listings_latest_src_10003.created_at AS listing__created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__year - , listings_latest_src_10003.country AS listing__country_latest - , listings_latest_src_10003.is_lux AS listing__is_lux_latest - , listings_latest_src_10003.capacity AS listing__capacity_latest - , listings_latest_src_10003.listing_id AS listing - , listings_latest_src_10003.user_id AS user - , listings_latest_src_10003.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10003 - ) subq_0 - ) subq_1 - ) subq_2 - GROUP BY - subq_2.listing__country_latest -) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql deleted file mode 100644 index 601a66767c..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_local_dimension_using_local_identifier__plan0_optimized.sql +++ /dev/null @@ -1,17 +0,0 @@ --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(listings) AS listings - , listing__country_latest -FROM ( - -- Read Elements From Data Source 'listings_latest' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: - -- ['listings', 'listing__country_latest'] - SELECT - 1 AS listings - , country AS listing__country_latest - FROM ***************************.dim_listings_latest listings_latest_src_10003 -) subq_6 -GROUP BY - listing__country_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_measure_aggregation_node__plan0.sql deleted file mode 100644 index 94c8ba613f..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_measure_aggregation_node__plan0.sql +++ /dev/null @@ -1,70 +0,0 @@ --- Aggregate Measures -SELECT - SUM(subq_1.bookings) AS bookings - , SUM(subq_1.instant_bookings) AS instant_bookings - , COUNT(DISTINCT subq_1.bookers) AS bookers - , AVG(subq_1.average_booking_value) AS average_booking_value -FROM ( - -- Pass Only Elements: - -- ['bookings', 'instant_bookings', 'average_booking_value', 'bookers'] - SELECT - subq_0.bookings - , subq_0.instant_bookings - , subq_0.bookers - , subq_0.average_booking_value - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 -) subq_1 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_multi_join_node__plan0.sql deleted file mode 100644 index 4aeaafca24..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_multi_join_node__plan0.sql +++ /dev/null @@ -1,160 +0,0 @@ --- Join Standard Outputs -SELECT - subq_1.bookings AS bookings - , subq_3.country_latest AS listing__country_latest - , subq_5.country_latest AS listing__country_latest - , subq_1.listing AS listing -FROM ( - -- Pass Only Elements: - -- ['bookings', 'listing'] - SELECT - subq_0.bookings - , subq_0.listing - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 -) subq_1 -LEFT OUTER JOIN ( - -- Pass Only Elements: - -- ['listing', 'country_latest'] - SELECT - subq_2.country_latest - , subq_2.listing - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10003.capacity AS largest_listing - , listings_latest_src_10003.capacity AS smallest_listing - , listings_latest_src_10003.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , listings_latest_src_10003.created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__year - , listings_latest_src_10003.country AS country_latest - , listings_latest_src_10003.is_lux AS is_lux_latest - , listings_latest_src_10003.capacity AS capacity_latest - , listings_latest_src_10003.created_at AS listing__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__year - , listings_latest_src_10003.created_at AS listing__created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__year - , listings_latest_src_10003.country AS listing__country_latest - , listings_latest_src_10003.is_lux AS listing__is_lux_latest - , listings_latest_src_10003.capacity AS listing__capacity_latest - , listings_latest_src_10003.listing_id AS listing - , listings_latest_src_10003.user_id AS user - , listings_latest_src_10003.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10003 - ) subq_2 -) subq_3 -ON - subq_1.listing = subq_3.listing -LEFT OUTER JOIN ( - -- Pass Only Elements: - -- ['listing', 'country_latest'] - SELECT - subq_4.country_latest - , subq_4.listing - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10003.capacity AS largest_listing - , listings_latest_src_10003.capacity AS smallest_listing - , listings_latest_src_10003.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , listings_latest_src_10003.created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__year - , listings_latest_src_10003.country AS country_latest - , listings_latest_src_10003.is_lux AS is_lux_latest - , listings_latest_src_10003.capacity AS capacity_latest - , listings_latest_src_10003.created_at AS listing__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__year - , listings_latest_src_10003.created_at AS listing__created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__year - , listings_latest_src_10003.country AS listing__country_latest - , listings_latest_src_10003.is_lux AS listing__is_lux_latest - , listings_latest_src_10003.capacity AS listing__capacity_latest - , listings_latest_src_10003.listing_id AS listing - , listings_latest_src_10003.user_id AS user - , listings_latest_src_10003.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10003 - ) subq_4 -) subq_5 -ON - subq_1.listing = subq_5.listing diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_multihop_node__plan0.sql deleted file mode 100644 index 346ea94338..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_multihop_node__plan0.sql +++ /dev/null @@ -1,218 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_10.txn_count - , subq_10.account_id__customer_id__customer_name -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_9.txn_count) AS txn_count - , subq_9.account_id__customer_id__customer_name - FROM ( - -- Pass Only Elements: - -- ['txn_count', 'account_id__customer_id__customer_name'] - SELECT - subq_8.txn_count - , subq_8.account_id__customer_id__customer_name - FROM ( - -- Join Standard Outputs - SELECT - subq_2.txn_count AS txn_count - , subq_7.customer_id__customer_name AS account_id__customer_id__customer_name - , subq_2.ds_partitioned AS ds_partitioned - , subq_7.ds_partitioned AS account_id__ds_partitioned - , subq_2.account_id AS account_id - FROM ( - -- Pass Only Elements: - -- ['txn_count', 'account_id', 'ds_partitioned'] - SELECT - subq_1.txn_count - , subq_1.ds_partitioned - , subq_1.account_id - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.txn_count - , subq_0.account_month - , subq_0.account_id__account_month - , subq_0.ds_partitioned - , subq_0.ds_partitioned__week - , subq_0.ds_partitioned__month - , subq_0.ds_partitioned__quarter - , subq_0.ds_partitioned__year - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.account_id__ds_partitioned - , subq_0.account_id__ds_partitioned__week - , subq_0.account_id__ds_partitioned__month - , subq_0.account_id__ds_partitioned__quarter - , subq_0.account_id__ds_partitioned__year - , subq_0.account_id__ds - , subq_0.account_id__ds__week - , subq_0.account_id__ds__month - , subq_0.account_id__ds__quarter - , subq_0.account_id__ds__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.account_id - FROM ( - -- Read Elements From Data Source 'account_month_txns' - SELECT - account_month_txns_src_10009.txn_count - , account_month_txns_src_10009.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , account_month_txns_src_10009.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , account_month_txns_src_10009.account_month - , account_month_txns_src_10009.ds_partitioned AS account_id__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds_partitioned__year - , account_month_txns_src_10009.ds AS account_id__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds__year - , account_month_txns_src_10009.account_month AS account_id__account_month - , account_month_txns_src_10009.account_id - FROM ***************************.account_month_txns account_month_txns_src_10009 - ) subq_0 - ) subq_1 - ) subq_2 - LEFT OUTER JOIN ( - -- Pass Only Elements: - -- ['account_id', 'ds_partitioned', 'customer_id__customer_name'] - SELECT - subq_6.customer_id__customer_name - , subq_6.ds_partitioned - , subq_6.account_id - FROM ( - -- Join Standard Outputs - SELECT - subq_3.extra_dim AS extra_dim - , subq_3.account_id__extra_dim AS account_id__extra_dim - , subq_5.customer_name AS customer_id__customer_name - , subq_5.customer_atomic_weight AS customer_id__customer_atomic_weight - , subq_3.ds_partitioned AS ds_partitioned - , subq_3.ds_partitioned__week AS ds_partitioned__week - , subq_3.ds_partitioned__month AS ds_partitioned__month - , subq_3.ds_partitioned__quarter AS ds_partitioned__quarter - , subq_3.ds_partitioned__year AS ds_partitioned__year - , subq_3.account_id__ds_partitioned AS account_id__ds_partitioned - , subq_3.account_id__ds_partitioned__week AS account_id__ds_partitioned__week - , subq_3.account_id__ds_partitioned__month AS account_id__ds_partitioned__month - , subq_3.account_id__ds_partitioned__quarter AS account_id__ds_partitioned__quarter - , subq_3.account_id__ds_partitioned__year AS account_id__ds_partitioned__year - , subq_5.ds_partitioned AS customer_id__ds_partitioned - , subq_5.ds_partitioned__week AS customer_id__ds_partitioned__week - , subq_5.ds_partitioned__month AS customer_id__ds_partitioned__month - , subq_5.ds_partitioned__quarter AS customer_id__ds_partitioned__quarter - , subq_5.ds_partitioned__year AS customer_id__ds_partitioned__year - , subq_3.account_id AS account_id - , subq_3.customer_id AS customer_id - , subq_3.account_id__customer_id AS account_id__customer_id - FROM ( - -- Read Elements From Data Source 'bridge_table' - SELECT - bridge_table_src_10010.extra_dim - , bridge_table_src_10010.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bridge_table_src_10010.extra_dim AS account_id__extra_dim - , bridge_table_src_10010.ds_partitioned AS account_id__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS account_id__ds_partitioned__year - , bridge_table_src_10010.account_id - , bridge_table_src_10010.customer_id - , bridge_table_src_10010.customer_id AS account_id__customer_id - FROM ***************************.bridge_table bridge_table_src_10010 - ) subq_3 - LEFT OUTER JOIN ( - -- Pass Only Elements: - -- ['customer_name', - -- 'customer_atomic_weight', - -- 'customer_id__customer_name', - -- 'customer_id__customer_atomic_weight', - -- 'customer_id', - -- 'ds_partitioned', - -- 'ds_partitioned__week', - -- 'ds_partitioned__month', - -- 'ds_partitioned__quarter', - -- 'ds_partitioned__year', - -- 'customer_id__ds_partitioned', - -- 'customer_id__ds_partitioned__week', - -- 'customer_id__ds_partitioned__month', - -- 'customer_id__ds_partitioned__quarter', - -- 'customer_id__ds_partitioned__year'] - SELECT - subq_4.customer_name - , subq_4.customer_atomic_weight - , subq_4.customer_id__customer_name - , subq_4.customer_id__customer_atomic_weight - , subq_4.ds_partitioned - , subq_4.ds_partitioned__week - , subq_4.ds_partitioned__month - , subq_4.ds_partitioned__quarter - , subq_4.ds_partitioned__year - , subq_4.customer_id__ds_partitioned - , subq_4.customer_id__ds_partitioned__week - , subq_4.customer_id__ds_partitioned__month - , subq_4.customer_id__ds_partitioned__quarter - , subq_4.customer_id__ds_partitioned__year - , subq_4.customer_id - FROM ( - -- Read Elements From Data Source 'customer_table' - SELECT - customer_table_src_10012.customer_name - , customer_table_src_10012.customer_atomic_weight - , customer_table_src_10012.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , customer_table_src_10012.customer_name AS customer_id__customer_name - , customer_table_src_10012.customer_atomic_weight AS customer_id__customer_atomic_weight - , customer_table_src_10012.ds_partitioned AS customer_id__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS customer_id__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS customer_id__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS customer_id__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS customer_id__ds_partitioned__year - , customer_table_src_10012.customer_id - FROM ***************************.customer_table customer_table_src_10012 - ) subq_4 - ) subq_5 - ON - ( - subq_3.customer_id = subq_5.customer_id - ) AND ( - subq_3.ds_partitioned = subq_5.ds_partitioned - ) - ) subq_6 - ) subq_7 - ON - ( - subq_2.account_id = subq_7.account_id - ) AND ( - subq_2.ds_partitioned = subq_7.ds_partitioned - ) - ) subq_8 - ) subq_9 - GROUP BY - subq_9.account_id__customer_id__customer_name -) subq_10 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_multihop_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_multihop_node__plan0_optimized.sql deleted file mode 100644 index 7c403cb5e3..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_multihop_node__plan0_optimized.sql +++ /dev/null @@ -1,35 +0,0 @@ --- Join Standard Outputs --- Pass Only Elements: --- ['txn_count', 'account_id__customer_id__customer_name'] --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(account_month_txns_src_10009.txn_count) AS txn_count - , subq_18.customer_id__customer_name AS account_id__customer_id__customer_name -FROM ***************************.account_month_txns account_month_txns_src_10009 -LEFT OUTER JOIN ( - -- Join Standard Outputs - -- Pass Only Elements: - -- ['account_id', 'ds_partitioned', 'customer_id__customer_name'] - SELECT - customer_table_src_10012.customer_name AS customer_id__customer_name - , bridge_table_src_10010.ds_partitioned AS ds_partitioned - , bridge_table_src_10010.account_id AS account_id - FROM ***************************.bridge_table bridge_table_src_10010 - LEFT OUTER JOIN - ***************************.customer_table customer_table_src_10012 - ON - ( - bridge_table_src_10010.customer_id = customer_table_src_10012.customer_id - ) AND ( - bridge_table_src_10010.ds_partitioned = customer_table_src_10012.ds_partitioned - ) -) subq_18 -ON - ( - account_month_txns_src_10009.account_id = subq_18.account_id - ) AND ( - account_month_txns_src_10009.ds_partitioned = subq_18.ds_partitioned - ) -GROUP BY - subq_18.customer_id__customer_name diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_order_by_node__plan0.sql deleted file mode 100644 index dfa5e0a8fc..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_order_by_node__plan0.sql +++ /dev/null @@ -1,86 +0,0 @@ --- Order By ['ds', 'bookings'] -SELECT - subq_3.bookings - , subq_3.is_instant - , subq_3.ds -FROM ( - -- Compute Metrics via Expressions - SELECT - subq_2.bookings - , subq_2.is_instant - , subq_2.ds - FROM ( - -- Aggregate Measures - SELECT - SUM(subq_1.bookings) AS bookings - , subq_1.is_instant - , subq_1.ds - FROM ( - -- Pass Only Elements: - -- ['bookings', 'is_instant', 'ds'] - SELECT - subq_0.bookings - , subq_0.is_instant - , subq_0.ds - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 - ) subq_1 - GROUP BY - subq_1.is_instant - , subq_1.ds - ) subq_2 -) subq_3 -ORDER BY subq_3.ds, subq_3.bookings DESC diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_partitioned_join__plan0.sql deleted file mode 100644 index 4d61b08685..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_partitioned_join__plan0.sql +++ /dev/null @@ -1,154 +0,0 @@ --- Compute Metrics via Expressions -SELECT - subq_7.identity_verifications - , subq_7.user__home_state -FROM ( - -- Aggregate Measures - SELECT - SUM(subq_6.identity_verifications) AS identity_verifications - , subq_6.user__home_state - FROM ( - -- Pass Only Elements: - -- ['identity_verifications', 'user__home_state'] - SELECT - subq_5.identity_verifications - , subq_5.user__home_state - FROM ( - -- Join Standard Outputs - SELECT - subq_2.identity_verifications AS identity_verifications - , subq_4.home_state AS user__home_state - , subq_2.ds_partitioned AS ds_partitioned - , subq_4.ds_partitioned AS user__ds_partitioned - , subq_2.user AS user - FROM ( - -- Pass Only Elements: - -- ['identity_verifications', 'user', 'ds_partitioned'] - SELECT - subq_1.identity_verifications - , subq_1.ds_partitioned - , subq_1.user - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.identity_verifications - , subq_0.verification_type - , subq_0.verification__verification_type - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds_partitioned - , subq_0.ds_partitioned__week - , subq_0.ds_partitioned__month - , subq_0.ds_partitioned__quarter - , subq_0.ds_partitioned__year - , subq_0.verification__ds - , subq_0.verification__ds__week - , subq_0.verification__ds__month - , subq_0.verification__ds__quarter - , subq_0.verification__ds__year - , subq_0.verification__ds_partitioned - , subq_0.verification__ds_partitioned__week - , subq_0.verification__ds_partitioned__month - , subq_0.verification__ds_partitioned__quarter - , subq_0.verification__ds_partitioned__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.verification - , subq_0.user - , subq_0.verification__user - FROM ( - -- Read Elements From Data Source 'id_verifications' - SELECT - 1 AS identity_verifications - , id_verifications_src_10002.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , id_verifications_src_10002.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , id_verifications_src_10002.verification_type - , id_verifications_src_10002.ds AS verification__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS verification__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS verification__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS verification__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS verification__ds__year - , id_verifications_src_10002.ds_partitioned AS verification__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS verification__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS verification__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS verification__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS verification__ds_partitioned__year - , id_verifications_src_10002.verification_type AS verification__verification_type - , id_verifications_src_10002.verification_id AS verification - , id_verifications_src_10002.user_id AS user - , id_verifications_src_10002.user_id AS verification__user - FROM ***************************.fct_id_verifications id_verifications_src_10002 - ) subq_0 - ) subq_1 - ) subq_2 - LEFT OUTER JOIN ( - -- Pass Only Elements: - -- ['user', 'ds_partitioned', 'home_state'] - SELECT - subq_3.home_state - , subq_3.ds_partitioned - , subq_3.user - FROM ( - -- Read Elements From Data Source 'users_ds_source' - SELECT - users_ds_source_src_10006.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , users_ds_source_src_10006.created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__year - , users_ds_source_src_10006.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , users_ds_source_src_10006.home_state - , users_ds_source_src_10006.ds AS user__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__ds__year - , users_ds_source_src_10006.created_at AS user__created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__created_at__year - , users_ds_source_src_10006.ds_partitioned AS user__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS user__ds_partitioned__year - , users_ds_source_src_10006.home_state AS user__home_state - , users_ds_source_src_10006.user_id AS user - FROM ***************************.dim_users users_ds_source_src_10006 - ) subq_3 - ) subq_4 - ON - ( - subq_2.user = subq_4.user - ) AND ( - subq_2.ds_partitioned = subq_4.ds_partitioned - ) - ) subq_5 - ) subq_6 - GROUP BY - subq_6.user__home_state -) subq_7 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_partitioned_join__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_partitioned_join__plan0_optimized.sql deleted file mode 100644 index f68773f5a6..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_partitioned_join__plan0_optimized.sql +++ /dev/null @@ -1,29 +0,0 @@ --- Join Standard Outputs --- Pass Only Elements: --- ['identity_verifications', 'user__home_state'] --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(subq_10.identity_verifications) AS identity_verifications - , users_ds_source_src_10006.home_state AS user__home_state -FROM ( - -- Read Elements From Data Source 'id_verifications' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: - -- ['identity_verifications', 'user', 'ds_partitioned'] - SELECT - 1 AS identity_verifications - , ds_partitioned - , user_id AS user - FROM ***************************.fct_id_verifications id_verifications_src_10002 -) subq_10 -LEFT OUTER JOIN - ***************************.dim_users users_ds_source_src_10006 -ON - ( - subq_10.user = users_ds_source_src_10006.user_id - ) AND ( - subq_10.ds_partitioned = users_ds_source_src_10006.ds_partitioned - ) -GROUP BY - users_ds_source_src_10006.home_state diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_single_join_node__plan0.sql deleted file mode 100644 index c30c1225b7..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_single_join_node__plan0.sql +++ /dev/null @@ -1,113 +0,0 @@ --- Join Standard Outputs -SELECT - subq_1.bookings AS bookings - , subq_3.country_latest AS listing__country_latest - , subq_1.listing AS listing -FROM ( - -- Pass Only Elements: - -- ['bookings', 'listing'] - SELECT - subq_0.bookings - , subq_0.listing - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 -) subq_1 -LEFT OUTER JOIN ( - -- Pass Only Elements: - -- ['listing', 'country_latest'] - SELECT - subq_2.country_latest - , subq_2.listing - FROM ( - -- Read Elements From Data Source 'listings_latest' - SELECT - 1 AS listings - , listings_latest_src_10003.capacity AS largest_listing - , listings_latest_src_10003.capacity AS smallest_listing - , listings_latest_src_10003.created_at AS ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , listings_latest_src_10003.created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS created_at__year - , listings_latest_src_10003.country AS country_latest - , listings_latest_src_10003.is_lux AS is_lux_latest - , listings_latest_src_10003.capacity AS capacity_latest - , listings_latest_src_10003.created_at AS listing__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__ds__year - , listings_latest_src_10003.created_at AS listing__created_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS listing__created_at__year - , listings_latest_src_10003.country AS listing__country_latest - , listings_latest_src_10003.is_lux AS listing__is_lux_latest - , listings_latest_src_10003.capacity AS listing__capacity_latest - , listings_latest_src_10003.listing_id AS listing - , listings_latest_src_10003.user_id AS user - , listings_latest_src_10003.user_id AS listing__user - FROM ***************************.dim_listings_latest listings_latest_src_10003 - ) subq_2 -) subq_3 -ON - subq_1.listing = subq_3.listing diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_source_node__plan0.sql deleted file mode 100644 index 4eee9fd1c5..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_source_node__plan0.sql +++ /dev/null @@ -1,53 +0,0 @@ --- Read Elements From Data Source 'bookings_source' -SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_source_node__plan0_optimized.sql deleted file mode 100644 index 654673a858..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/SqliteSqlClient/test_source_node__plan0_optimized.sql +++ /dev/null @@ -1,53 +0,0 @@ --- Read Elements From Data Source 'bookings_source' -SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , booking_value - , booking_value AS max_booking_value - , booking_value AS min_booking_value - , guest_id AS bookers - , booking_value AS average_booking_value - , booking_value AS booking_payments - , is_instant - , ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , is_instant AS create_a_cycle_in_the_join_graph__is_instant - , ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , listing_id AS listing - , guest_id AS guest - , host_id AS host - , guest_id AS create_a_cycle_in_the_join_graph - , listing_id AS create_a_cycle_in_the_join_graph__listing - , guest_id AS create_a_cycle_in_the_join_graph__guest - , host_id AS create_a_cycle_in_the_join_graph__host -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_primary_time_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_primary_time_dimension__plan0.xml deleted file mode 100644 index a3dc0f923b..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_primary_time_dimension__plan0.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_identifier__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_identifier__plan0.xml deleted file mode 100644 index b04db1c2a1..0000000000 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_identifier__plan0.xml +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/metricflow/test/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/DatabricksSqlClient/test_discrete_percentile_expr__plan0.sql b/metricflow/test/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/DatabricksSqlClient/test_discrete_percentile_expr__plan0.sql deleted file mode 100644 index da3b2e8628..0000000000 --- a/metricflow/test/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/DatabricksSqlClient/test_discrete_percentile_expr__plan0.sql +++ /dev/null @@ -1,4 +0,0 @@ --- Test Discrete Percentile Expression -SELECT - PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY (a.col0)) AS col0_percentile -FROM foo.bar a diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql deleted file mode 100644 index ac5bd0d005..0000000000 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ /dev/null @@ -1,102 +0,0 @@ --- Metric Time Dimension 'booking_paid_at' -SELECT - subq_0.booking_payments - , subq_0.is_instant - , subq_0.create_a_cycle_in_the_join_graph__is_instant - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds_partitioned - , subq_0.ds_partitioned__week - , subq_0.ds_partitioned__month - , subq_0.ds_partitioned__quarter - , subq_0.ds_partitioned__year - , subq_0.booking_paid_at - , subq_0.booking_paid_at__week - , subq_0.booking_paid_at__month - , subq_0.booking_paid_at__quarter - , subq_0.booking_paid_at__year - , subq_0.create_a_cycle_in_the_join_graph__ds - , subq_0.create_a_cycle_in_the_join_graph__ds__week - , subq_0.create_a_cycle_in_the_join_graph__ds__month - , subq_0.create_a_cycle_in_the_join_graph__ds__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds__year - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__week - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__month - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__year - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__week - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__month - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__year - , subq_0.booking_paid_at AS metric_time - , subq_0.booking_paid_at__week AS metric_time__week - , subq_0.booking_paid_at__month AS metric_time__month - , subq_0.booking_paid_at__quarter AS metric_time__quarter - , subq_0.booking_paid_at__year AS metric_time__year - , subq_0.listing - , subq_0.guest - , subq_0.host - , subq_0.create_a_cycle_in_the_join_graph - , subq_0.create_a_cycle_in_the_join_graph__listing - , subq_0.create_a_cycle_in_the_join_graph__guest - , subq_0.create_a_cycle_in_the_join_graph__host -FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 -) subq_0 diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql deleted file mode 100644 index 85770789fe..0000000000 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql +++ /dev/null @@ -1,52 +0,0 @@ --- Read Elements From Data Source 'bookings_source' --- Metric Time Dimension 'booking_paid_at' -SELECT - booking_value AS booking_payments - , is_instant - , is_instant AS create_a_cycle_in_the_join_graph__is_instant - , ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , booking_paid_at AS metric_time - , '__DATE_TRUNC_NOT_SUPPORTED__' AS metric_time__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS metric_time__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS metric_time__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS metric_time__year - , listing_id AS listing - , guest_id AS guest - , host_id AS host - , guest_id AS create_a_cycle_in_the_join_graph - , listing_id AS create_a_cycle_in_the_join_graph__listing - , guest_id AS create_a_cycle_in_the_join_graph__guest - , host_id AS create_a_cycle_in_the_join_graph__host -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql deleted file mode 100644 index b8edf6627d..0000000000 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ /dev/null @@ -1,108 +0,0 @@ --- Metric Time Dimension 'ds' -SELECT - subq_0.bookings - , subq_0.instant_bookings - , subq_0.booking_value - , subq_0.max_booking_value - , subq_0.min_booking_value - , subq_0.bookers - , subq_0.average_booking_value - , subq_0.is_instant - , subq_0.create_a_cycle_in_the_join_graph__is_instant - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds_partitioned - , subq_0.ds_partitioned__week - , subq_0.ds_partitioned__month - , subq_0.ds_partitioned__quarter - , subq_0.ds_partitioned__year - , subq_0.booking_paid_at - , subq_0.booking_paid_at__week - , subq_0.booking_paid_at__month - , subq_0.booking_paid_at__quarter - , subq_0.booking_paid_at__year - , subq_0.create_a_cycle_in_the_join_graph__ds - , subq_0.create_a_cycle_in_the_join_graph__ds__week - , subq_0.create_a_cycle_in_the_join_graph__ds__month - , subq_0.create_a_cycle_in_the_join_graph__ds__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds__year - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__week - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__month - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__year - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__week - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__month - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.guest - , subq_0.host - , subq_0.create_a_cycle_in_the_join_graph - , subq_0.create_a_cycle_in_the_join_graph__listing - , subq_0.create_a_cycle_in_the_join_graph__guest - , subq_0.create_a_cycle_in_the_join_graph__host -FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 -) subq_0 diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql deleted file mode 100644 index 8b7d69155b..0000000000 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ /dev/null @@ -1,58 +0,0 @@ --- Read Elements From Data Source 'bookings_source' --- Metric Time Dimension 'ds' -SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , booking_value - , booking_value AS max_booking_value - , booking_value AS min_booking_value - , guest_id AS bookers - , booking_value AS average_booking_value - , is_instant - , is_instant AS create_a_cycle_in_the_join_graph__is_instant - , ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , ds AS metric_time - , '__DATE_TRUNC_NOT_SUPPORTED__' AS metric_time__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS metric_time__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS metric_time__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS metric_time__year - , listing_id AS listing - , guest_id AS guest - , host_id AS host - , guest_id AS create_a_cycle_in_the_join_graph - , listing_id AS create_a_cycle_in_the_join_graph__listing - , guest_id AS create_a_cycle_in_the_join_graph__guest - , host_id AS create_a_cycle_in_the_join_graph__host -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_metric_time_dimension__plan0.sql deleted file mode 100644 index cc5d2de57d..0000000000 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_metric_time_dimension__plan0.sql +++ /dev/null @@ -1,263 +0,0 @@ --- Combine Metrics -SELECT - subq_8.bookings AS bookings - , subq_9.booking_payments AS booking_payments - , COALESCE(subq_8.metric_time, subq_9.metric_time) AS metric_time -FROM ( - -- Compute Metrics via Expressions - SELECT - subq_3.bookings - , subq_3.metric_time - FROM ( - -- Aggregate Measures - SELECT - SUM(subq_2.bookings) AS bookings - , subq_2.metric_time - FROM ( - -- Pass Only Elements: - -- ['bookings', 'metric_time'] - SELECT - subq_1.bookings - , subq_1.metric_time - FROM ( - -- Metric Time Dimension 'ds' - SELECT - subq_0.bookings - , subq_0.instant_bookings - , subq_0.booking_value - , subq_0.max_booking_value - , subq_0.min_booking_value - , subq_0.bookers - , subq_0.average_booking_value - , subq_0.is_instant - , subq_0.create_a_cycle_in_the_join_graph__is_instant - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds_partitioned - , subq_0.ds_partitioned__week - , subq_0.ds_partitioned__month - , subq_0.ds_partitioned__quarter - , subq_0.ds_partitioned__year - , subq_0.booking_paid_at - , subq_0.booking_paid_at__week - , subq_0.booking_paid_at__month - , subq_0.booking_paid_at__quarter - , subq_0.booking_paid_at__year - , subq_0.create_a_cycle_in_the_join_graph__ds - , subq_0.create_a_cycle_in_the_join_graph__ds__week - , subq_0.create_a_cycle_in_the_join_graph__ds__month - , subq_0.create_a_cycle_in_the_join_graph__ds__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds__year - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__week - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__month - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__year - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__week - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__month - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__year - , subq_0.ds AS metric_time - , subq_0.ds__week AS metric_time__week - , subq_0.ds__month AS metric_time__month - , subq_0.ds__quarter AS metric_time__quarter - , subq_0.ds__year AS metric_time__year - , subq_0.listing - , subq_0.guest - , subq_0.host - , subq_0.create_a_cycle_in_the_join_graph - , subq_0.create_a_cycle_in_the_join_graph__listing - , subq_0.create_a_cycle_in_the_join_graph__guest - , subq_0.create_a_cycle_in_the_join_graph__host - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 - ) subq_1 - ) subq_2 - GROUP BY - subq_2.metric_time - ) subq_3 -) subq_8 -FULL OUTER JOIN ( - -- Compute Metrics via Expressions - SELECT - subq_7.booking_payments - , subq_7.metric_time - FROM ( - -- Aggregate Measures - SELECT - SUM(subq_6.booking_payments) AS booking_payments - , subq_6.metric_time - FROM ( - -- Pass Only Elements: - -- ['booking_payments', 'metric_time'] - SELECT - subq_5.booking_payments - , subq_5.metric_time - FROM ( - -- Metric Time Dimension 'booking_paid_at' - SELECT - subq_4.booking_payments - , subq_4.is_instant - , subq_4.create_a_cycle_in_the_join_graph__is_instant - , subq_4.ds - , subq_4.ds__week - , subq_4.ds__month - , subq_4.ds__quarter - , subq_4.ds__year - , subq_4.ds_partitioned - , subq_4.ds_partitioned__week - , subq_4.ds_partitioned__month - , subq_4.ds_partitioned__quarter - , subq_4.ds_partitioned__year - , subq_4.booking_paid_at - , subq_4.booking_paid_at__week - , subq_4.booking_paid_at__month - , subq_4.booking_paid_at__quarter - , subq_4.booking_paid_at__year - , subq_4.create_a_cycle_in_the_join_graph__ds - , subq_4.create_a_cycle_in_the_join_graph__ds__week - , subq_4.create_a_cycle_in_the_join_graph__ds__month - , subq_4.create_a_cycle_in_the_join_graph__ds__quarter - , subq_4.create_a_cycle_in_the_join_graph__ds__year - , subq_4.create_a_cycle_in_the_join_graph__ds_partitioned - , subq_4.create_a_cycle_in_the_join_graph__ds_partitioned__week - , subq_4.create_a_cycle_in_the_join_graph__ds_partitioned__month - , subq_4.create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , subq_4.create_a_cycle_in_the_join_graph__ds_partitioned__year - , subq_4.create_a_cycle_in_the_join_graph__booking_paid_at - , subq_4.create_a_cycle_in_the_join_graph__booking_paid_at__week - , subq_4.create_a_cycle_in_the_join_graph__booking_paid_at__month - , subq_4.create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , subq_4.create_a_cycle_in_the_join_graph__booking_paid_at__year - , subq_4.booking_paid_at AS metric_time - , subq_4.booking_paid_at__week AS metric_time__week - , subq_4.booking_paid_at__month AS metric_time__month - , subq_4.booking_paid_at__quarter AS metric_time__quarter - , subq_4.booking_paid_at__year AS metric_time__year - , subq_4.listing - , subq_4.guest - , subq_4.host - , subq_4.create_a_cycle_in_the_join_graph - , subq_4.create_a_cycle_in_the_join_graph__listing - , subq_4.create_a_cycle_in_the_join_graph__guest - , subq_4.create_a_cycle_in_the_join_graph__host - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_4 - ) subq_5 - ) subq_6 - GROUP BY - subq_6.metric_time - ) subq_7 -) subq_9 -ON - subq_8.metric_time = subq_9.metric_time diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_metric_time_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_metric_time_dimension__plan0_optimized.sql deleted file mode 100644 index 6ae3237e91..0000000000 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_metric_time_dimension__plan0_optimized.sql +++ /dev/null @@ -1,46 +0,0 @@ --- Combine Metrics -SELECT - subq_18.bookings AS bookings - , subq_19.booking_payments AS booking_payments - , COALESCE(subq_18.metric_time, subq_19.metric_time) AS metric_time -FROM ( - -- Aggregate Measures - -- Compute Metrics via Expressions - SELECT - SUM(bookings) AS bookings - , metric_time - FROM ( - -- Read Elements From Data Source 'bookings_source' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: - -- ['bookings', 'metric_time'] - SELECT - 1 AS bookings - , ds AS metric_time - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_12 - GROUP BY - metric_time -) subq_18 -FULL OUTER JOIN ( - -- Read Elements From Data Source 'bookings_source' - -- Metric Time Dimension 'booking_paid_at' - -- Pass Only Elements: - -- ['booking_payments', 'metric_time'] - -- Aggregate Measures - -- Compute Metrics via Expressions - SELECT - SUM(booking_value) AS booking_payments - , booking_paid_at AS metric_time - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - GROUP BY - booking_paid_at -) subq_19 -ON - subq_18.metric_time = subq_19.metric_time diff --git a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_non_primary_time__plan0.sql deleted file mode 100644 index 2281394eaf..0000000000 --- a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ /dev/null @@ -1,102 +0,0 @@ --- Set Measures to Aggregate By 'booking_paid_at' -SELECT - subq_0.booking_payments - , subq_0.is_instant - , subq_0.create_a_cycle_in_the_join_graph__is_instant - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds_partitioned - , subq_0.ds_partitioned__week - , subq_0.ds_partitioned__month - , subq_0.ds_partitioned__quarter - , subq_0.ds_partitioned__year - , subq_0.booking_paid_at - , subq_0.booking_paid_at__week - , subq_0.booking_paid_at__month - , subq_0.booking_paid_at__quarter - , subq_0.booking_paid_at__year - , subq_0.create_a_cycle_in_the_join_graph__ds - , subq_0.create_a_cycle_in_the_join_graph__ds__week - , subq_0.create_a_cycle_in_the_join_graph__ds__month - , subq_0.create_a_cycle_in_the_join_graph__ds__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds__year - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__week - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__month - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__year - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__week - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__month - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__year - , subq_0.booking_paid_at AS __ts - , subq_0.booking_paid_at__week AS __ts__week - , subq_0.booking_paid_at__month AS __ts__month - , subq_0.booking_paid_at__quarter AS __ts__quarter - , subq_0.booking_paid_at__year AS __ts__year - , subq_0.listing - , subq_0.guest - , subq_0.host - , subq_0.create_a_cycle_in_the_join_graph - , subq_0.create_a_cycle_in_the_join_graph__listing - , subq_0.create_a_cycle_in_the_join_graph__guest - , subq_0.create_a_cycle_in_the_join_graph__host -FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 -) subq_0 diff --git a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql deleted file mode 100644 index d3a1db7d1d..0000000000 --- a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql +++ /dev/null @@ -1,52 +0,0 @@ --- Read Elements From Data Source 'bookings_source' --- Set Measures to Aggregate By 'booking_paid_at' -SELECT - booking_value AS booking_payments - , is_instant - , is_instant AS create_a_cycle_in_the_join_graph__is_instant - , ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , booking_paid_at AS __ts - , '__DATE_TRUNC_NOT_SUPPORTED__' AS __ts__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS __ts__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS __ts__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS __ts__year - , listing_id AS listing - , guest_id AS guest - , host_id AS host - , guest_id AS create_a_cycle_in_the_join_graph - , listing_id AS create_a_cycle_in_the_join_graph__listing - , guest_id AS create_a_cycle_in_the_join_graph__guest - , host_id AS create_a_cycle_in_the_join_graph__host -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 diff --git a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_primary_time__plan0.sql deleted file mode 100644 index 1be0ef1fe0..0000000000 --- a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_primary_time__plan0.sql +++ /dev/null @@ -1,108 +0,0 @@ --- Set Measures to Aggregate By 'ds' -SELECT - subq_0.bookings - , subq_0.instant_bookings - , subq_0.booking_value - , subq_0.max_booking_value - , subq_0.min_booking_value - , subq_0.bookers - , subq_0.average_booking_value - , subq_0.is_instant - , subq_0.create_a_cycle_in_the_join_graph__is_instant - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds_partitioned - , subq_0.ds_partitioned__week - , subq_0.ds_partitioned__month - , subq_0.ds_partitioned__quarter - , subq_0.ds_partitioned__year - , subq_0.booking_paid_at - , subq_0.booking_paid_at__week - , subq_0.booking_paid_at__month - , subq_0.booking_paid_at__quarter - , subq_0.booking_paid_at__year - , subq_0.create_a_cycle_in_the_join_graph__ds - , subq_0.create_a_cycle_in_the_join_graph__ds__week - , subq_0.create_a_cycle_in_the_join_graph__ds__month - , subq_0.create_a_cycle_in_the_join_graph__ds__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds__year - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__week - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__month - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__year - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__week - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__month - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__year - , subq_0.ds AS __ts - , subq_0.ds__week AS __ts__week - , subq_0.ds__month AS __ts__month - , subq_0.ds__quarter AS __ts__quarter - , subq_0.ds__year AS __ts__year - , subq_0.listing - , subq_0.guest - , subq_0.host - , subq_0.create_a_cycle_in_the_join_graph - , subq_0.create_a_cycle_in_the_join_graph__listing - , subq_0.create_a_cycle_in_the_join_graph__guest - , subq_0.create_a_cycle_in_the_join_graph__host -FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 -) subq_0 diff --git a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_primary_time__plan0_optimized.sql deleted file mode 100644 index 3e3edab013..0000000000 --- a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_plot_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ /dev/null @@ -1,58 +0,0 @@ --- Read Elements From Data Source 'bookings_source' --- Set Measures to Aggregate By 'ds' -SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , booking_value - , booking_value AS max_booking_value - , booking_value AS min_booking_value - , guest_id AS bookers - , booking_value AS average_booking_value - , is_instant - , is_instant AS create_a_cycle_in_the_join_graph__is_instant - , ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , ds AS __ts - , '__DATE_TRUNC_NOT_SUPPORTED__' AS __ts__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS __ts__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS __ts__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS __ts__year - , listing_id AS listing - , guest_id AS guest - , host_id AS host - , guest_id AS create_a_cycle_in_the_join_graph - , listing_id AS create_a_cycle_in_the_join_graph__listing - , guest_id AS create_a_cycle_in_the_join_graph__guest - , host_id AS create_a_cycle_in_the_join_graph__host -FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings -) bookings_source_src_10000 diff --git a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_plot_time_dimension__plan0.sql b/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_plot_time_dimension__plan0.sql deleted file mode 100644 index fdd263eb43..0000000000 --- a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_plot_time_dimension__plan0.sql +++ /dev/null @@ -1,263 +0,0 @@ --- Combine Metrics -SELECT - subq_8.bookings AS bookings - , subq_9.booking_payments AS booking_payments - , COALESCE(subq_8._ts, subq_9._ts) AS _ts -FROM ( - -- Compute Metrics via Expressions - SELECT - subq_3.bookings - , subq_3._ts - FROM ( - -- Aggregate Measures - SELECT - SUM(subq_2.bookings) AS bookings - , subq_2._ts - FROM ( - -- Pass Only Elements: - -- ['bookings', '_ts'] - SELECT - subq_1.bookings - , subq_1._ts - FROM ( - -- Plot by Time Dimension 'ds' - SELECT - subq_0.bookings - , subq_0.instant_bookings - , subq_0.booking_value - , subq_0.max_booking_value - , subq_0.min_booking_value - , subq_0.bookers - , subq_0.average_booking_value - , subq_0.is_instant - , subq_0.create_a_cycle_in_the_join_graph__is_instant - , subq_0.ds - , subq_0.ds__week - , subq_0.ds__month - , subq_0.ds__quarter - , subq_0.ds__year - , subq_0.ds_partitioned - , subq_0.ds_partitioned__week - , subq_0.ds_partitioned__month - , subq_0.ds_partitioned__quarter - , subq_0.ds_partitioned__year - , subq_0.booking_paid_at - , subq_0.booking_paid_at__week - , subq_0.booking_paid_at__month - , subq_0.booking_paid_at__quarter - , subq_0.booking_paid_at__year - , subq_0.create_a_cycle_in_the_join_graph__ds - , subq_0.create_a_cycle_in_the_join_graph__ds__week - , subq_0.create_a_cycle_in_the_join_graph__ds__month - , subq_0.create_a_cycle_in_the_join_graph__ds__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds__year - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__week - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__month - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , subq_0.create_a_cycle_in_the_join_graph__ds_partitioned__year - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__week - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__month - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , subq_0.create_a_cycle_in_the_join_graph__booking_paid_at__year - , subq_0.ds AS _ts - , subq_0.ds__week AS _ts__week - , subq_0.ds__month AS _ts__month - , subq_0.ds__quarter AS _ts__quarter - , subq_0.ds__year AS _ts__year - , subq_0.listing - , subq_0.guest - , subq_0.host - , subq_0.create_a_cycle_in_the_join_graph - , subq_0.create_a_cycle_in_the_join_graph__listing - , subq_0.create_a_cycle_in_the_join_graph__guest - , subq_0.create_a_cycle_in_the_join_graph__host - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_0 - ) subq_1 - ) subq_2 - GROUP BY - subq_2._ts - ) subq_3 -) subq_8 -FULL OUTER JOIN ( - -- Compute Metrics via Expressions - SELECT - subq_7.booking_payments - , subq_7._ts - FROM ( - -- Aggregate Measures - SELECT - SUM(subq_6.booking_payments) AS booking_payments - , subq_6._ts - FROM ( - -- Pass Only Elements: - -- ['booking_payments', '_ts'] - SELECT - subq_5.booking_payments - , subq_5._ts - FROM ( - -- Plot by Time Dimension 'booking_paid_at' - SELECT - subq_4.booking_payments - , subq_4.is_instant - , subq_4.create_a_cycle_in_the_join_graph__is_instant - , subq_4.ds - , subq_4.ds__week - , subq_4.ds__month - , subq_4.ds__quarter - , subq_4.ds__year - , subq_4.ds_partitioned - , subq_4.ds_partitioned__week - , subq_4.ds_partitioned__month - , subq_4.ds_partitioned__quarter - , subq_4.ds_partitioned__year - , subq_4.booking_paid_at - , subq_4.booking_paid_at__week - , subq_4.booking_paid_at__month - , subq_4.booking_paid_at__quarter - , subq_4.booking_paid_at__year - , subq_4.create_a_cycle_in_the_join_graph__ds - , subq_4.create_a_cycle_in_the_join_graph__ds__week - , subq_4.create_a_cycle_in_the_join_graph__ds__month - , subq_4.create_a_cycle_in_the_join_graph__ds__quarter - , subq_4.create_a_cycle_in_the_join_graph__ds__year - , subq_4.create_a_cycle_in_the_join_graph__ds_partitioned - , subq_4.create_a_cycle_in_the_join_graph__ds_partitioned__week - , subq_4.create_a_cycle_in_the_join_graph__ds_partitioned__month - , subq_4.create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , subq_4.create_a_cycle_in_the_join_graph__ds_partitioned__year - , subq_4.create_a_cycle_in_the_join_graph__booking_paid_at - , subq_4.create_a_cycle_in_the_join_graph__booking_paid_at__week - , subq_4.create_a_cycle_in_the_join_graph__booking_paid_at__month - , subq_4.create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , subq_4.create_a_cycle_in_the_join_graph__booking_paid_at__year - , subq_4.booking_paid_at AS _ts - , subq_4.booking_paid_at__week AS _ts__week - , subq_4.booking_paid_at__month AS _ts__month - , subq_4.booking_paid_at__quarter AS _ts__quarter - , subq_4.booking_paid_at__year AS _ts__year - , subq_4.listing - , subq_4.guest - , subq_4.host - , subq_4.create_a_cycle_in_the_join_graph - , subq_4.create_a_cycle_in_the_join_graph__listing - , subq_4.create_a_cycle_in_the_join_graph__guest - , subq_4.create_a_cycle_in_the_join_graph__host - FROM ( - -- Read Elements From Data Source 'bookings_source' - SELECT - 1 AS bookings - , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings - , bookings_source_src_10000.booking_value - , bookings_source_src_10000.booking_value AS max_booking_value - , bookings_source_src_10000.booking_value AS min_booking_value - , bookings_source_src_10000.guest_id AS bookers - , bookings_source_src_10000.booking_value AS average_booking_value - , bookings_source_src_10000.booking_value AS booking_payments - , bookings_source_src_10000.is_instant - , bookings_source_src_10000.ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds__year - , bookings_source_src_10000.ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS ds_partitioned__year - , bookings_source_src_10000.booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS booking_paid_at__year - , bookings_source_src_10000.is_instant AS create_a_cycle_in_the_join_graph__is_instant - , bookings_source_src_10000.ds AS create_a_cycle_in_the_join_graph__ds - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds__year - , bookings_source_src_10000.ds_partitioned AS create_a_cycle_in_the_join_graph__ds_partitioned - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__ds_partitioned__year - , bookings_source_src_10000.booking_paid_at AS create_a_cycle_in_the_join_graph__booking_paid_at - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__week - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__month - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__quarter - , '__DATE_TRUNC_NOT_SUPPORTED__' AS create_a_cycle_in_the_join_graph__booking_paid_at__year - , bookings_source_src_10000.listing_id AS listing - , bookings_source_src_10000.guest_id AS guest - , bookings_source_src_10000.host_id AS host - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph - , bookings_source_src_10000.listing_id AS create_a_cycle_in_the_join_graph__listing - , bookings_source_src_10000.guest_id AS create_a_cycle_in_the_join_graph__guest - , bookings_source_src_10000.host_id AS create_a_cycle_in_the_join_graph__host - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_4 - ) subq_5 - ) subq_6 - GROUP BY - subq_6._ts - ) subq_7 -) subq_9 -ON - subq_8._ts = subq_9._ts diff --git a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_plot_time_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_plot_time_dimension__plan0_optimized.sql deleted file mode 100644 index 1a63ebff43..0000000000 --- a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/SqliteSqlClient/test_simple_query_with_plot_time_dimension__plan0_optimized.sql +++ /dev/null @@ -1,46 +0,0 @@ --- Combine Metrics -SELECT - subq_18.bookings AS bookings - , subq_19.booking_payments AS booking_payments - , COALESCE(subq_18._ts, subq_19._ts) AS _ts -FROM ( - -- Aggregate Measures - -- Compute Metrics via Expressions - SELECT - SUM(bookings) AS bookings - , _ts - FROM ( - -- Read Elements From Data Source 'bookings_source' - -- Plot by Time Dimension 'ds' - -- Pass Only Elements: - -- ['bookings', '_ts'] - SELECT - 1 AS bookings - , ds AS _ts - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - ) subq_12 - GROUP BY - _ts -) subq_18 -FULL OUTER JOIN ( - -- Read Elements From Data Source 'bookings_source' - -- Plot by Time Dimension 'booking_paid_at' - -- Pass Only Elements: - -- ['booking_payments', '_ts'] - -- Aggregate Measures - -- Compute Metrics via Expressions - SELECT - SUM(booking_value) AS booking_payments - , booking_paid_at AS _ts - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_10000 - GROUP BY - booking_paid_at -) subq_19 -ON - subq_18._ts = subq_19._ts diff --git a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/test_plot_time_dimension_transform_node_using_non_primary_time__plan0.xml b/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/test_plot_time_dimension_transform_node_using_non_primary_time__plan0.xml deleted file mode 100644 index 4b35f069ab..0000000000 --- a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/test_plot_time_dimension_transform_node_using_non_primary_time__plan0.xml +++ /dev/null @@ -1,386 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/test_plot_time_dimension_transform_node_using_primary_time__plan0.xml b/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/test_plot_time_dimension_transform_node_using_primary_time__plan0.xml deleted file mode 100644 index 934be4e456..0000000000 --- a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/test_plot_time_dimension_transform_node_using_primary_time__plan0.xml +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_plot_time_dimension__plan0.xml b/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_plot_time_dimension__plan0.xml deleted file mode 100644 index dd722374cc..0000000000 --- a/metricflow/test/snapshots/test_plot_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_plot_time_dimension__plan0.xml +++ /dev/null @@ -1,914 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/BigQuerySqlClient/test_render_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/BigQuerySqlClient/test_render_query__query0.sql index 5b37c13239..c9bc79326d 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/BigQuerySqlClient/test_render_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/BigQuerySqlClient/test_render_query__query0.sql @@ -11,7 +11,7 @@ FROM ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/BigQuerySqlClient/test_render_write_to_table_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/BigQuerySqlClient/test_render_write_to_table_query__query0.sql index 820df4bb75..288ae17f63 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/BigQuerySqlClient/test_render_write_to_table_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/BigQuerySqlClient/test_render_write_to_table_query__query0.sql @@ -12,7 +12,7 @@ CREATE TABLE ***************************.test_table AS ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DatabricksSqlClient/test_render_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DatabricksSqlClient/test_render_query__query0.sql index 5b37c13239..c9bc79326d 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DatabricksSqlClient/test_render_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DatabricksSqlClient/test_render_query__query0.sql @@ -11,7 +11,7 @@ FROM ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DatabricksSqlClient/test_render_write_to_table_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DatabricksSqlClient/test_render_write_to_table_query__query0.sql index 820df4bb75..288ae17f63 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DatabricksSqlClient/test_render_write_to_table_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DatabricksSqlClient/test_render_write_to_table_query__query0.sql @@ -12,7 +12,7 @@ CREATE TABLE ***************************.test_table AS ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DuckDbSqlClient/test_render_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DuckDbSqlClient/test_render_query__query0.sql index 5b37c13239..c9bc79326d 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DuckDbSqlClient/test_render_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DuckDbSqlClient/test_render_query__query0.sql @@ -11,7 +11,7 @@ FROM ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DuckDbSqlClient/test_render_write_to_table_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DuckDbSqlClient/test_render_write_to_table_query__query0.sql index 820df4bb75..288ae17f63 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DuckDbSqlClient/test_render_write_to_table_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/DuckDbSqlClient/test_render_write_to_table_query__query0.sql @@ -12,7 +12,7 @@ CREATE TABLE ***************************.test_table AS ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/PostgresSqlClient/test_render_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/PostgresSqlClient/test_render_query__query0.sql index 5b37c13239..c9bc79326d 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/PostgresSqlClient/test_render_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/PostgresSqlClient/test_render_query__query0.sql @@ -11,7 +11,7 @@ FROM ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/PostgresSqlClient/test_render_write_to_table_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/PostgresSqlClient/test_render_write_to_table_query__query0.sql index 820df4bb75..288ae17f63 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/PostgresSqlClient/test_render_write_to_table_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/PostgresSqlClient/test_render_write_to_table_query__query0.sql @@ -12,7 +12,7 @@ CREATE TABLE ***************************.test_table AS ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/RedshiftSqlClient/test_render_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/RedshiftSqlClient/test_render_query__query0.sql index 5b37c13239..c9bc79326d 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/RedshiftSqlClient/test_render_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/RedshiftSqlClient/test_render_query__query0.sql @@ -11,7 +11,7 @@ FROM ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/RedshiftSqlClient/test_render_write_to_table_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/RedshiftSqlClient/test_render_write_to_table_query__query0.sql index 820df4bb75..288ae17f63 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/RedshiftSqlClient/test_render_write_to_table_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/RedshiftSqlClient/test_render_write_to_table_query__query0.sql @@ -12,7 +12,7 @@ CREATE TABLE ***************************.test_table AS ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SnowflakeSqlClient/test_render_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SnowflakeSqlClient/test_render_query__query0.sql index 5b37c13239..c9bc79326d 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SnowflakeSqlClient/test_render_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SnowflakeSqlClient/test_render_query__query0.sql @@ -11,7 +11,7 @@ FROM ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SnowflakeSqlClient/test_render_write_to_table_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SnowflakeSqlClient/test_render_write_to_table_query__query0.sql index 820df4bb75..288ae17f63 100644 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SnowflakeSqlClient/test_render_write_to_table_query__query0.sql +++ b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SnowflakeSqlClient/test_render_write_to_table_query__query0.sql @@ -12,7 +12,7 @@ CREATE TABLE ***************************.test_table AS ( SELECT ds , 1 AS bookings - FROM ***************************.fct_bookings bookings_source_src_3 + FROM ***************************.fct_bookings bookings_source_src_1 ) subq_2 GROUP BY ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SqliteSqlClient/test_render_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SqliteSqlClient/test_render_query__query0.sql deleted file mode 100644 index ac18953992..0000000000 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SqliteSqlClient/test_render_query__query0.sql +++ /dev/null @@ -1,26 +0,0 @@ --- Aggregate Measures --- Compute Metrics via Expressions -SELECT - SUM(bookings) AS bookings - , ds -FROM ( - -- Read Elements From Data Source 'bookings_source' - -- Metric Time Dimension 'ds' - -- Constrain Time Range to [2000-01-01T00:00:00, 2040-12-31T00:00:00] - -- Pass Only Elements: - -- ['bookings', 'ds'] - SELECT - 1 AS bookings - , ds - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_0 - WHERE ( - ds >= CAST('2000-01-01' AS TEXT) - ) AND ( - ds <= CAST('2040-12-31' AS TEXT) - ) -) subq_3 -GROUP BY - ds diff --git a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SqliteSqlClient/test_render_write_to_table_query__query0.sql b/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SqliteSqlClient/test_render_write_to_table_query__query0.sql deleted file mode 100644 index 07a8fd19ff..0000000000 --- a/metricflow/test/snapshots/test_rendered_query.py/MetricFlowExplainResult/SqliteSqlClient/test_render_write_to_table_query__query0.sql +++ /dev/null @@ -1,28 +0,0 @@ -CREATE TABLE ***************************.test_table AS ( - -- Aggregate Measures - -- Compute Metrics via Expressions - SELECT - SUM(bookings) AS bookings - , ds - FROM ( - -- Read Elements From Data Source 'bookings_source' - -- Metric Time Dimension 'ds' - -- Constrain Time Range to [2000-01-01T00:00:00, 2040-12-31T00:00:00] - -- Pass Only Elements: - -- ['bookings', 'ds'] - SELECT - 1 AS bookings - , ds - FROM ( - -- User Defined SQL Query - SELECT * FROM ***************************.fct_bookings - ) bookings_source_src_0 - WHERE ( - ds >= CAST('2000-01-01' AS TEXT) - ) AND ( - ds <= CAST('2040-12-31' AS TEXT) - ) - ) subq_3 - GROUP BY - ds -)